Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#26,243 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@RishavTiwari25 がすでに取り組んでいます。

2026年10月13日 から。

  • #26254 @RishavTiwari25 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
80/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
backend, databases

調査の方向性

まず ArrayConcat::coerce_types と ArrayConcat::return_type を読み、特に issue で説明されているフォールバック coerced_type_with_base_type_only を確認してください。datafusion-cli で SELECT array_concat([1, 2], NULL) を実行して問題を再現し、その後、配列連結に関する既存のテストと #16349 の型付き NULL のケースを確認してください。型なしの NULL を使ったクエリが [1, 2] を返し、報告された array_cat の形式がテストでカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
9.4k
フォーク
2.5k
平均マージ
4日 5時間
マージ済み PR(30日)
331

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/datafusion のほかの issue

apache/datafusion の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。