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

Ouverte Adaptée aux débutants
#7,622 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

@Visorgood y travaille déjà.

Depuis le 14/11/2026.

  • #7627 par @Visorgood — ouverte

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
65/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
scala

Piste de recherche

Les deux nœuds d'écriture sont IcebergWriteExec et CometIcebergWriteExec ; le ticket indique que les deux reçoivent output comme argument du constructeur sans redéfinir producedAttributes. Regarde CometProjectExec pour voir comment cette redéfinition est déjà faite. Reproduis ensuite avec les commandes EXPLAIN du ticket et vérifie que missingInput est vide. C'est terminé lorsque le préfixe ! disparaît et qu'une assertion sur missingInput.isEmpty passe dans un test d'écriture existant de CometIcebergWriteActionSuite.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
Scala
Étoiles
1.3k
Forks
418
Merge moyen
2 j 23 h
PR mergées (30 j)
158

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de apache/datafusion-comet

Toutes les issues de apache/datafusion-comet

Issues similaires

Plus d'issues Scala

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.