Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta Para iniciantes
#26,243 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@RishavTiwari25 já está trabalhando nisso.

Desde 13/10/2026.

  • #26254 de @RishavTiwari25 — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
80/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
rust
Domínio
backend, databases

Direção de pesquisa

Comece lendo ArrayConcat::coerce_types e ArrayConcat::return_type, especialmente o fallback coerced_type_with_base_type_only descrito na issue. Reproduza a falha com SELECT array_concat([1, 2], NULL) no datafusion-cli e, em seguida, confira os testes existentes sobre concatenação de arrays e o caso de NULL tipado de #16349. O trabalho estará concluído quando a consulta com NULL sem tipo retornar [1, 2] e a forma array_cat relatada estiver coberta.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Rust
Estrelas
9.5k
Forks
2.5k
Merge médio
4d 16h
PRs com merge (30d)
330

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de apache/datafusion

Todas as issues de apache/datafusion

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.