[VL] Struct fields are read from the wrong column when two same-named struct columns meet in one projection
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start by reading ExpressionConverter.bindGetStructField, identified in the issue, and trace how it resolves the root attribute and struct fields for the two repro queries. Run the repros with the default configuration and compare Gluten’s results with vanilla Spark. Done means both projections return the same field values as Spark, including when struct columns or fields share names.
索引モデルが issue の本文から書いたものです。
説明
Backend
Velox (Bolt shares the same binding code).
Bug description
When a projection's input holds two struct attributes with the same name but different field layouts, Gluten reads struct fields from the wrong one. ExpressionConverter.bindGetStructField re-resolves the root attribute of a GetStructField chain by name over the whole input and keeps the last match, so l.s.x and r.s.x are both bound against whichever s comes last.
Repro with the default configuration:
spark.sql("select id, named_struct('x', id, 'y', id * 100) as s from range(5)").write.parquet("/tmp/l")
spark.sql("select id, named_struct('y', id * 100, 'x', id) as s from range(5)").write.parquet("/tmp/r")
spark.read.parquet("/tmp/l").createOrReplaceTempView("l")
spark.read.parquet("/tmp/r").createOrReplaceTempView("r")
spark.sql("select l.s.x, l.s.y, r.s.x, r.s.y from l join r on l.id = r.id").show()
Vanilla Spark returns [1, 100, 1, 100] for id 1. Gluten returns [100, 1, 1, 100].
The same function also looks each field up by name and keeps the last match, which misreads structs with duplicate field names. The Velox generate rewrite builds such a struct from the generator output aliases, so select v.* from (select id, array(named_struct('p', id, 'q', id * 10)) as arr from range(5)) lateral view inline(arr) v as x, x returns [10, 10] for id 1 instead of [1, 10].
Gluten version
main (ca7a0a4e4)
Spark version
Spark 3.5
This issue was written with the assistance of AI (Claude Opus).
- 主要言語
- Scala
- スター
- 1.6k
- フォーク
- 685
- 平均マージ
- 4日 16時間
- マージ済み PR(30日)
- 84
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/gluten のほかの issue
-
[CORE] Selecting a cost model the backend has no coster for fails with ClassNotFoundException対応中かも @LuciferYang が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 3 日以内に返信
-
bug unit testing velox backend
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/gluten#13463 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 3 日以内に返信
-
[VL] madvise(WILLNEED) call fails in MmapFileStream because of wrong calculation of fetching length再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rchillyard/TableParser#206 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
? - Needs Triage bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
NVIDIA/cudf-spark#17063 ·
メンテナーはふだん 2 日以内に返信
-
bug 🐞 User issue 🚨
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
valkey-io/valkey-glide#7813 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信