Skip to content

API: Propagate allowMissing to nested StructProjection#16168

Closed
sachinnn99 wants to merge 1 commit intoapache:mainfrom
sachinnn99:fix/16123-struct-projection-allow-missing
Closed

API: Propagate allowMissing to nested StructProjection#16168
sachinnn99 wants to merge 1 commit intoapache:mainfrom
sachinnn99:fix/16123-struct-projection-allow-missing

Conversation

@sachinnn99
Copy link
Copy Markdown
Contributor

Fixes #16123.

StructProjection.createAllowMissing() does not propagate allowMissing to nested struct sub-projections. When a nested struct's projected schema contains optional fields not present in the data schema, the constructor throws IllegalArgumentException instead of treating the missing field as null.

The bug is on line 126 where the nested StructProjection is created using the 2-arg constructor, which defaults allowMissing=false.

Fix: Pass allowMissing through to the nested StructProjection constructor.

Tests: Added TestStructProjection covering:

  • Nested struct with a missing optional field via createAllowMissing (returns null)
  • Same setup with create() throws IllegalArgumentException
  • 3-level deep nesting to verify recursive propagation
  • All fields present still projects values correctly with allowMissing=true

@github-actions github-actions Bot added the API label Apr 30, 2026
@sachinnn99 sachinnn99 force-pushed the fix/16123-struct-projection-allow-missing branch from 8ec341a to ef168fe Compare April 30, 2026 05:17
@sachinnn99
Copy link
Copy Markdown
Contributor Author

Closing in favor of #15984 which already covers this fix with comprehensive test coverage.

@sachinnn99 sachinnn99 closed this Apr 30, 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