Skip to content

API: Propagate allowMissing to nested structs in StructProjection#17052

Open
thswlsqls wants to merge 1 commit into
apache:mainfrom
thswlsqls:fix/struct-projection-allow-missing-nested
Open

API: Propagate allowMissing to nested structs in StructProjection#17052
thswlsqls wants to merge 1 commit into
apache:mainfrom
thswlsqls:fix/struct-projection-allow-missing-nested

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Closes #16123

Summary

Testing done

  • Added TestStructProjection#createAllowMissingAllowsMissingOptionalFieldInNestedStruct and #createStillThrowsForMissingOptionalFieldInNestedStruct, covering the positive (allowMissing) and negative (strict create) cases for a missing optional nested field.
  • Verified red -> green: the new positive-case test fails with IllegalArgumentException against the unmodified constructor, and passes after the fix.
  • ./gradlew :iceberg-api:check — 1197 tests passed, 0 failures.
  • ./gradlew :iceberg-api:revapi — passed (only a private constructor call site changed).

StructProjection's private 3-arg constructor recurses into a nested
struct field using the 2-arg constructor, which always passes
allowMissing=false. As a result, StructProjection.createAllowMissing
still throws IllegalArgumentException when an optional field is
missing inside a nested struct, even though the top-level struct
allows missing fields as documented.

Pass the outer allowMissing value through to the recursive call for
the STRUCT case so nested structs behave the same as the top level.

Closes apache#16123

Generated-by: Claude Code
@github-actions github-actions Bot added the API label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API: StructProjection.createAllowMissing does not propagate allowMissing to nested struct sub-projections

1 participant