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

Đang mở Phù hợp với người mới
#7,622 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@Visorgood đang làm issue này rồi.

Từ ngày 14/11/2026.

  • #7627 của @Visorgood — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
scala
Lĩnh vực
data-engineering

Hướng nghiên cứu

Hai nút ghi là IcebergWriteExec và CometIcebergWriteExec; issue cho biết cả hai đều nhận output làm tham số constructor mà không ghi đè producedAttributes. Hãy xem CometProjectExec để biết cách ghi đè này đã được thực hiện ra sao. Sau đó, tái hiện lỗi bằng các lệnh EXPLAIN trong issue và kiểm tra missingInput có rỗng hay không. Công việc hoàn tất khi tiền tố ! biến mất và một assertion trên missingInput.isEmpty đạt trong một test ghi hiện có của CometIcebergWriteActionSuite.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Scala
Star
1.3k
Fork
418
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
158

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/datafusion-comet

Tất cả issue của apache/datafusion-comet

Issue tương tự

Thêm issue về Scala

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.