Scalar subquery in a VALUES row fails with "Internal error: ScalarSubqueryExpr evaluated before the subquery was executed"
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
調査の方向性
Start by reading LogicalPlan::Values and MemorySourceConfig::try_new_as_values, then trace how ScalarSubqueryExpr is evaluated by ScalarSubqueryExec. Add regression coverage for the three SQL examples, including the expected (1, 5) result and inserted row. A linked pull request is already open, so this work is underway.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
A VALUES clause whose rows contain an uncorrelated scalar subquery fails during physical planning with an internal error:
Internal error: ScalarSubqueryExpr evaluated before the subquery was executed. This issue was likely caused by a bug in DataFusion's code.
LogicalPlan::Values is processed by MemorySourceConfig::try_new_as_values, which attempts to evaluate every row expression while the physical plan is built. Under physical scalar subquery execution, an uncorrelated scalar subquery is represented as a ScalarSubqueryExpr, which expects execution-time evaluation inside ScalarSubqueryExec. Because the subquery has not yet run at planning time, evaluation fails with an internal error.
To Reproduce
VALUES ((SELECT 1), 5);
SELECT * FROM (VALUES ((SELECT min(x) FROM (VALUES (1), (2)) AS v(x)), 5)) AS t(a, b);
CREATE TABLE v (a BIGINT, b BIGINT);
INSERT INTO v VALUES ((SELECT 1), 5);
Expected behavior
The first two SELECT queries should return (1, 5). The INSERT statement should insert one row (1, 5) into table v.
Additional context
Reproduced on main at commit bc86321 (57.0.0-dev) and with datafusion-python 55.0.0. Found using an automated grammar-based SQL fuzzer.
Willingness to contribute
I plan to contribute a fix for this bug independently
- 主要言語
- Rust
- スター
- 9.6k
- フォーク
- 2.6k
- 平均マージ
- 3日 4時間
- マージ済み PR(30日)
- 345
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/datafusion のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/datafusion#27315 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/datafusion#27094 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yaml対応中かも @jonasHanhan が 9 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/datafusion#27059 ·
メンテナーはふだん 1 日以内に返信
-
`ProjectionExprs::project_statistics` computes approximate `Statistics::total_byte_size` ignoring column stats対応中かも @joseph-isaacs が 10 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/datafusion#27050 ·
メンテナーはふだん 1 日以内に返信
-
physical-plan: decoding an Unnest or Explain node with an unset field panics対応中かも @geoHeil が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/datafusion#26999 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
apache/datafusion の issue をすべて見る
似ている issue
-
area:schema documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ElectronicWave/Elemental#252 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dekobon/big-code-analysis#1887 ·
メンテナーはふだん 1 日以内に返信
-
Shell中文符号输入异常オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信