Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`array_concat` with an untyped `NULL` argument fails with "does not support type Int64"

Aperta Adatta ai principianti
#26,243 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@RishavTiwari25 ci sta già lavorando.

Dal 13/10/2026.

  • #26254 di @RishavTiwari25 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
80/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend, databases

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

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/datafusion

Tutte le issue di apache/datafusion

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.