Skip to content

test: cover a native Iceberg read of a data file that omits an optional nested field - #7359

Open
yunchipang wants to merge 1 commit into
apache:mainfrom
yunchipang:test/iceberg-omitted-optional-nested-field
Open

yunchipang wants to merge 1 commit into
apache:mainfrom
yunchipang:test/iceberg-omitted-optional-nested-field

Conversation

@yunchipang

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #7033.

Rationale for this change

The native Iceberg scan failed with Incorrect number of arrays for StructArray fields, expected 2 got 1 when a data file omitted an optional nested field without a schema change. The iceberg-rust bump in #7028 fixed this, since iceberg-rust now matches nested fields by field id and fills in missing ones with NULLs. Nothing tested this case.

What changes are included in this PR?

A test in CometIcebergNativeSuite that writes a data file without s.b and l.element.y, using write.spark.accept-any-schema. It then checks that the native scan matches Spark, with nested schema pruning on and off.

How are these changes tested?

The new test passes on main. On the parent of #7028, it fails with the error from the issue.

@github-actions github-actions Bot added enhancement New feature or request test Testing related area:Iceberg labels Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Iceberg enhancement New feature or request test Testing related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native Iceberg scan fails when a data file omits an optional nested field

1 participant