`array_concat` with an untyped `NULL` argument fails with "does not support type Int64"
Los mantenedores suelen responder en 1 día
@RishavTiwari25 ya está trabajando en esto.
Desde el 13/10/2026.
- #26254 de @RishavTiwari25 — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 80/100
Línea de trabajo
Empieza leyendo ArrayConcat::coerce_types y ArrayConcat::return_type, especialmente el fallback coerced_type_with_base_type_only descrito en la issue. Reproduce el fallo con SELECT array_concat([1, 2], NULL) en datafusion-cli y, después, revisa las pruebas existentes sobre la concatenación de arrays y el caso de NULL tipado de #16349. La tarea está terminada cuando la consulta con NULL sin tipo devuelve [1, 2] y queda cubierto el caso indicado de array_cat.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 9.4k
- Forks
- 2.5k
- Merge medio
- 4 d 5 h
- PR fusionados (30 d)
- 331
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/datafusion
-
array_min / array_max fail on a zero-row batch for non-primitive element typesPosiblemente ocupada @linuxpi la tomó hace 7 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
apache/datafusion#26072 ·
Los mantenedores suelen responder en 1 día
-
BaselineMetrics output_bytes converts every column to ArrayData for every batchPosiblemente ocupada @minhh-nguyen la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/datafusion#26071 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Replace manual `RowSelection` bitmap conversion with `force_mask()` after arrow-rs releasePosiblemente ocupada @isabellehuangg la tomó hace 8 días. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apache/datafusion#26030 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Lambda examples in the SQL function docs fail with the default dialectPosiblemente ocupada @Prajwal-k-tech la tomó hace 8 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
apache/datafusion#25960 ·
Los mantenedores suelen responder en 1 día
-
Spark `xxhash64` hashes the raw bits of a NaN instead of the canonical NaNPosiblemente ocupada @mrhard9090 la tomó hace 11 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
apache/datafusion#25913 ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/datafusion
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
extendr/extendr.github.io#134 ·
-
test(mixture): pin that gn / gn_hybrid are refused on a [mixture] model, whatever maxiter isAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bgreenwell/xleak#90 · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
cloudflare/boring#530 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
project-robius/robrix#1154 ·
Los mantenedores suelen responder en 1 día