`array_concat` with an untyped `NULL` argument fails with "does not support type Int64"
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 80/100
調査の方向性
まず 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
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/datafusion のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/datafusion#26259 ·
メンテナーはふだん 1 日以内に返信
-
array_min / array_max fail on a zero-row batch for non-primitive element types対応中かも @linuxpi が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/datafusion#26072 ·
メンテナーはふだん 1 日以内に返信
-
BaselineMetrics output_bytes converts every column to ArrayData for every batch対応中かも @minhh-nguyen が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/datafusion#26071 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Replace manual `RowSelection` bitmap conversion with `force_mask()` after arrow-rs release対応中かも @isabellehuangg が 9 日前に担当しました。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/datafusion#26030 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Lambda examples in the SQL function docs fail with the default dialect対応中かも @Prajwal-k-tech が 9 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
apache/datafusion#25960 ·
メンテナーはふだん 1 日以内に返信
apache/datafusion の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
V1 manifest lists written by Java lose added/existing/deleted file counts対応中かも @kacper-li-airspace-intelligence が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/iceberg-rust#3445 ·
メンテナーはふだん 4 日以内に返信
-
area::tern-sync kind::cleanup triage::ready
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
review-bot
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
midagedev/bloomery#160 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
oxidecomputer/humility#737 ·