`IcebergWriteExec` and `CometIcebergWriteExec` are marked with `!` (missing input) in EXPLAIN

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

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

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

2026年11月14日 から。

  • #7627 @Visorgood による — オープン

評価

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

調査の方向性

2つの書き込みノードは IcebergWriteExec と CometIcebergWriteExec です。issueによると、どちらもコンストラクタ引数として output を受け取っていますが、producedAttributes はオーバーライドしていません。CometProjectExec を見て、このオーバーライドが既にどのように実装されているかを確認してください。その後、issueのEXPLAINコマンドで再現し、missingInput が空であることを確認します。! プレフィックスが消え、CometIcebergWriteActionSuite の既存の書き込みテストで missingInput.isEmpty に対するアサーションが通れば完了です。

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

説明

bug requires-triage
Describe the bug

In the split Iceberg write plan, both write nodes are printed with Spark's ! prefix, which marks a node whose input attributes are missing:

IcebergCommit IcebergBatchWrite(table=local.db.dst, format=PARQUET), ...
+- AdaptiveSparkPlan isFinalPlan=false
   +- !CometIcebergWrite [iceberg_commit_message#303], ...

Both nodes take output (the iceberg_commit_message attribute) as a constructor argument but don't override producedAttributes. Spark therefore counts that attribute in references, and since no child produces it, missingInput is non-empty. The write itself runs correctly; the plan only looks broken.

This is the same class of issue as #2214 (CometHashAggregate) and #2789 (CometWindowExec).

Steps to reproduce

Comet main at 4de670439, Spark 4.1.3, Iceberg 1.11.0, spark-shell with a Hadoop catalog named local and spark.comet.write.iceberg.enabled=true:

spark.sql("CREATE TABLE local.db.src (id INT, amount INT) USING iceberg")
spark.sql("INSERT INTO local.db.src VALUES (1, 10), (2, 20)")
spark.sql("CREATE TABLE local.db.dst (id INT, amount INT) USING iceberg")
spark.sql("CREATE TABLE local.db.dst_orc (id INT, amount INT) USING iceberg TBLPROPERTIES ('write.format.default'='orc')")

// native write
spark.sql("EXPLAIN INSERT INTO local.db.dst SELECT * FROM local.db.src")
// ORC is not written natively, so the write stays on iceberg-java
spark.sql("EXPLAIN INSERT INTO local.db.dst_orc SELECT * FROM local.db.src")

Native write:

== Physical Plan ==
IcebergCommit IcebergBatchWrite(table=local.db.dst, format=PARQUET), IcebergWrite(table=local.db.dst, format=PARQUET), org.apache.comet.iceberg.IcebergWriteStrategy$$Lambda/0x00000070021c8ba8@1b766d44
+- !CometIcebergWrite [iceberg_commit_message#303], /tmp/iceberg-warehouse/db/dst/data, ICEBERG_WRITER_UNPARTITIONED
   +- CometIcebergNativeScan [id#292, amount#293], /tmp/iceberg-warehouse/db/src/metadata/v2.metadata.json, IcebergScan(table=local.db.src, schemaId=0, snapshotId=7721505751242735037, branch=null, filters=, runtimeFilters=, groupedBy=), 2

Fallback to iceberg-java:

== Physical Plan ==
IcebergCommit IcebergBatchWrite(table=local.db.dst_orc, format=ORC), IcebergWrite(table=local.db.dst_orc, format=ORC), org.apache.comet.iceberg.IcebergWriteStrategy$$Lambda/0x00000070021c8ba8@4ba48bc7
+- !IcebergWrite IcebergBatchWrite(table=local.db.dst_orc, format=ORC), [iceberg_commit_message#322], PlainIcebergWrite
   +- *(1) CometColumnarToRow
      +- CometIcebergNativeScan [id#311, amount#312], /tmp/iceberg-warehouse/db/src/metadata/v2.metadata.json, IcebergScan(table=local.db.src, schemaId=0, snapshotId=7721505751242735037, branch=null, filters=, runtimeFilters=, groupedBy=), 2
Expected behavior

No ! on IcebergWrite and CometIcebergWrite: the commit-message attribute is produced by the node itself, so missingInput should be empty.

Additional context

Proposed fix: override def producedAttributes: AttributeSet = outputSet in IcebergWriteExec and CometIcebergWriteExec, as CometProjectExec already does, plus a test that asserts missingInput.isEmpty for both nodes in an existing CometIcebergWriteActionSuite write.

Willingness to contribute

I can contribute a fix for this bug independently

主要言語
Scala
スター
1.3k
フォーク
418
平均マージ
2日 23時間
マージ済み PR(30日)
158

環境構築

はじめの一歩

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

apache/datafusion-comet のほかの issue

apache/datafusion-comet の issue をすべて見る

似ている issue

Scala の issue をもっと見る

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

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