thswlsqls opened a new pull request, #17052:
URL: https://github.com/apache/iceberg/pull/17052

   
   Closes #16123
   
   ## Summary
   
   - `StructProjection`'s private 3-arg constructor recurses into a STRUCT 
field via the 2-arg constructor, which always passes `allowMissing=false`.
   - As a result, `StructProjection.createAllowMissing(...)` still throws 
`IllegalArgumentException` for a missing optional field inside a nested struct, 
even though the top-level struct allows it.
   - Fix: pass the outer `allowMissing` value through to the recursive 
constructor call in the STRUCT case, so nested structs behave the same as the 
top level.
   - Related PRs (same bug, not duplicates): #15984 (closed by stale-bot, no 
design objection), #16168 (closed by author as duplicate of #15984).
   
   ## 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).
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to