Skip to content

fix (datafusion) IcebergWriteExec emits incorrect schema - #2975

Merged
blackmwk merged 3 commits into
apache:mainfrom
NoahKusaba:fix/iceberg-write-exec-schema
Aug 11, 2026
Merged

fix (datafusion) IcebergWriteExec emits incorrect schema#2975
blackmwk merged 3 commits into
apache:mainfrom
NoahKusaba:fix/iceberg-write-exec-schema

Conversation

@NoahKusaba

@NoahKusaba NoahKusaba commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Note that this is a API breaking change. We can keep the schema parameter as a dummy-value if that is a concern.

What changes are included in this PR?

Remove schema parameter from creating a new IcebergWriteExec and use
Self::make_result_schema()
for compute_properties

Tests

test_iceberg_write_exec_advertises_result_schema -> Asserts that IcebergWriteExec returns
&ArrowSchema::new(vec![Field::new(DATA_FILES_COL_NAME, DataType::Utf8, false)])

AI Disclosure

Helped identify the bug and write the test.

@NoahKusaba NoahKusaba changed the title init fix (datafusion) IcebergWriteExec emits incorrect schema Aug 7, 2026

@toutane toutane left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@anoopj anoopj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using conventional commit titles. You may want to change the PR title to:

fix(datafusion): IcebergWriteExec emits incorrect schema

ie no space after fix and need a colon

pub fn new(table: Table, input: Arc<dyn ExecutionPlan>, schema: ArrowSchemaRef) -> Self {
let plan_properties = Self::compute_properties(&input, schema);
pub fn new(table: Table, input: Arc<dyn ExecutionPlan>) -> Self {
let plan_properties = Self::compute_properties(&input, Self::make_result_schema());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just remove the schema from compute_properties?

@blackmwk blackmwk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @NoahKusaba for this fix!

@blackmwk
blackmwk merged commit 5417181 into apache:main Aug 11, 2026
21 checks passed
@NoahKusaba
NoahKusaba deleted the fix/iceberg-write-exec-schema branch August 11, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iceberg-datafusion] IcebergWriteExec advertises the input table schema instead of its actual output schema

4 participants