`array_concat` with an untyped `NULL` argument fails with "does not support type Int64"
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 80/100
Direzione di ricerca
Inizia leggendo ArrayConcat::coerce_types e ArrayConcat::return_type, in particolare il fallback coerced_type_with_base_type_only descritto nell’issue. Riproduci il problema con SELECT array_concat([1, 2], NULL) in datafusion-cli, poi controlla i test esistenti sulla concatenazione degli array e il caso di NULL tipizzato di #16349. Il lavoro è completato quando la query con NULL non tipizzato restituisce [1, 2] e il caso array_cat segnalato è coperto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
array_concat / array_cat fails to plan when one of the arguments is a plain NULL literal, and the error message names the element type of the other argument:
> SELECT array_concat([1, 2], NULL);
Error during planning: array_concat does not support type Int64
> SELECT array_cat(NULL, [1, 2]);
Error during planning: array_concat does not support type Int64
The same calls work when the NULL is typed (NULL::int[]) or when a NULL appears inside a list, so this is only the untyped literal:
> SELECT array_concat([1, 2], NULL::int[]);
[1, 2]
> SELECT array_concat([1, 2], [NULL]);
[1, 2, NULL]
ArrayConcat::return_type accepts DataType::Null arguments, but ArrayConcat::coerce_types runs every argument through coerced_type_with_base_type_only, whose fallback arm replaces a non-list type with the base type. The Null argument therefore becomes Int64, and the second return_type call rejects it.
To Reproduce
In datafusion-cli:
SELECT array_concat([1, 2], NULL);
SELECT array_cat(NULL, [1, 2]);
SELECT array_concat(['a'], NULL);
Expected behavior
The untyped NULL is treated like a NULL list of the result type and the other arguments are returned, matching PostgreSQL (array_cat(ARRAY[1, 2], NULL) is {1,2}) and the typed-NULL behavior above:
> SELECT array_concat([1, 2], NULL);
[1, 2]
Additional context
Reproduced on main at 6663e4348 (debug build of datafusion-cli).
#16349 covered NULL::int[] arguments; this is the remaining untyped case. I would like to work on this.
- Lingua principale
- Rust
- Stelle
- 9.4k
- Fork
- 2.5k
- Merge medio
- 4g 9h
- PR unite (30g)
- 329
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un 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 apache/datafusion
-
bug help wanted unparser
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/datafusion#26316 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Deduplicate bucket computation in width_bucket_interval_mdn_exactForse già presa @nightcityblade l’ha presa 1 giorno fa. Apertaenhancement good first issue help wanted spark tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
apache/datafusion#26307 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Use the shared aggr_test_schema in CSV scan tests instead of a local copyForse già presa @med9110 l’ha presa 1 giorno fa. Apertacore enhancement good first issue help wanted tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
apache/datafusion#26306 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
gcd benchmarks pass number_rows: 0 for 100k-row inputsForse già presa @med9110 l’ha presa 1 giorno fa. Apertabug functions good first issue help wanted tech debt
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
apache/datafusion#26297 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Struct union type coercion takes field nullability from the wrong field when field order differsForse già presa @med9110 l’ha presa oggi. Apertabug help wanted logical-expr tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/datafusion#26296 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/datafusion
Issue simili
-
agent:triaged bug bughunt pm:bundler priority:p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
SocketDev/socket-patch#1573 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
rustix::termios::Termios::OutputModes does not expost some const e.g. OLCUC for musl and macOSAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
bytecodealliance/rustix#1706 · 1 commento ·
I maintainer di solito rispondono entro 11 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
wormhole-foundation/wormhole#5062 ·
I maintainer di solito rispondono entro 1 giorno
-
LaunchOrFocusPlugin switches to the wrong tab after tabs are reordered (tab id used as position)Forse già presa @olegator888 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
zellij-org/zellij#5719 ·
I maintainer di solito rispondono entro 1 giorno