`append` twice with null columns leads to runtime Google BigQuery SQL error `UNION ALL has incompatible types`
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start with the related issue #5341 and trace how PRQL lowers nested append operations for the BigQuery target. Reproduce the supplied PRQL input and inspect the generated SQL and relevant tests; the issue names no source files or tests. Done means the generated BigQuery SQL uses subqueries and CTEs so repeated appends with null columns run without incompatible UNION ALL types.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened?
- Doing two
appendin Google BigQuery with null columns. prqlcoutputs a query that leads to runtime failureUNION ALL has incompatible types
PRQL input
prql target:sql.bigquery
from beers
select { name, price_per_l, alcohol_degree = null, brewing_date = null }
sort { +price_per_l }
take 2
append (
from beers
select { name, price_per_l = null, alcohol_degree, brewing_date = null }
sort { -alcohol_degree }
take 2
append (
from beers
select { name, price_per_l = null, alcohol_degree = null, brewing_date }
sort { -brewing_date }
take 2
)
)
SQL output
(
SELECT
name,
price_per_l,
NULL AS alcohol_degree,
NULL AS brewing_date
FROM
beers
ORDER BY
price_per_l
LIMIT
2
)
UNION
ALL (
SELECT
name,
NULL AS price_per_l,
alcohol_degree,
NULL AS brewing_date
FROM
beers
ORDER BY
alcohol_degree DESC
LIMIT
2
)
UNION
ALL (
SELECT
name,
NULL AS price_per_l,
NULL AS alcohol_degree,
brewing_date
FROM
beers
ORDER BY
brewing_date DESC
LIMIT
2
)
Expected SQL output
WITH cte0 as (
SELECT
name,
price_per_l
FROM
beers
ORDER BY
price_per_l
LIMIT
2
), cte1 as (
SELECT
name,
alcohol_degree,
FROM
beers
ORDER BY
alcohol_degree DESC
LIMIT
2
), cte2 as (
SELECT
name,
NULL AS price_per_l,
NULL AS alcohol_degree,
brewing_date
FROM
beers
ORDER BY
brewing_date DESC
LIMIT
2
)
(
SELECT
name,
price_per_l,
NULL AS alcohol_degree,
NULL AS brewing_date
FROM
cte0
)
UNION
ALL (
SELECT
name,
NULL AS price_per_l,
alcohol_degree,
NULL AS brewing_date
FROM
cte1
)
UNION
ALL (
SELECT
name,
NULL AS price_per_l,
NULL AS alcohol_degree,
brewing_date
FROM
cte2
)
MVCE confirmation
- Minimal example
- New issue
Anything else?
Related to https://github.com/PRQL/prql/issues/5341.
Unfortunately, Google BigQuery is even more picky, and needs both subqueries and CTEs to succesfully infer the types here.
- Lingua principale
- Rust
- Stelle
- 10.9k
- Fork
- 261
- Merge medio
- 3g 21h
- PR unite (30g)
- 84
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PRQL/prql
-
Underscore does not work as expectedForse già presa @prql-bot l’ha presa 1 giorno fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 3 giorni
-
prqlc Debug Report HTML Does Not Escape Source File Name, Enabling Stored XSS via PRQLC_DEBUG_LOGApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 3 giorni
-
Add `.prql` to linguistApertafriendliness integrations
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
PRQL/prql#1636 · 2 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 12/100
I maintainer di solito rispondono entro 3 giorni
-
review-runs-tracking
Difficoltà 3/5 Mezza giornata Idoneità per principianti 5/100
I maintainer di solito rispondono entro 3 giorni
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 2 giorni
-
Android visitors are offered the Linux .deb on cap.so's homepage and download pageForse già presa @patrickballard l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
CapSoftware/Cap#3677 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
DioxusLabs/blitz#1371 ·
I maintainer di solito rispondono entro 1 giorno