`array_concat` with an untyped `NULL` argument fails with "does not support type Int64"
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 80/100
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
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de apache/datafusion
-
[Bug] atan2 does not normalize -0.0 the way Spark doesTalvez já em andamento @spicysharkco assumiu há 1 dia. Abertabug spark
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
apache/datafusion#26333 ·
Mantenedores costumam responder em até 1 dia
-
bug help wanted unparser
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
apache/datafusion#26316 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Deduplicate bucket computation in width_bucket_interval_mdn_exactTalvez já em andamento @nightcityblade assumiu há 3 dias. Abertaenhancement good first issue help wanted spark tech debt
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
apache/datafusion#26307 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Use the shared aggr_test_schema in CSV scan tests instead of a local copyTalvez já em andamento @med9110 assumiu há 3 dias. Abertacore enhancement good first issue help wanted tech debt
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
apache/datafusion#26306 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
gcd benchmarks pass number_rows: 0 for 100k-row inputsTalvez já em andamento @med9110 assumiu há 3 dias. Abertabug functions good first issue help wanted tech debt
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
apache/datafusion#26297 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de apache/datafusion
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
bherbruck/solvecraft#2167 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
bitcoindevkit/bdk-cli#357 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
Wavvon/Wavvon-clients#136 ·
Mantenedores costumam responder em até 1 dia
-
GUI:纯报告任务验收后误显示“已合并”Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
vorton-lang/Lobotomy#95 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 63/100
AimesSoft/NipaPlay-Reload#1022 ·
Mantenedores costumam responder em até 1 dia