mikamikasuki opened a new pull request, #11368:
URL: https://github.com/apache/arrow-rs/pull/11368

   # Which issue does this PR close?
   
   Closes #11301.
   
   # Rationale for this change
   
   Casting a shredded Variant null or non-object scalar to an Arrow struct can 
produce a present struct with null fields, while the equivalent unshredded 
value produces a null struct in safe mode or a cast error in strict mode. This 
makes observable results depend on the physical shredding representation.
   
   The struct conversion path extracts child fields when `typed_value` is 
available, but previously used only the outer Variant validity for the result's 
parent validity. It therefore skipped checking whether each value was an object.
   
   # What changes are included in this PR?
   
   Preserve recursive field extraction while deriving struct parent validity 
from the actual shredded value. Non-object scalars and Variant nulls now become 
null structs in safe mode and raise the standard cast error in strict mode. 
Missing object-field sentinels remain valid structs with null children.
   
   # Are these changes tested?
   
   Regression coverage exercises scalar and null values with primitive and 
struct shredding schemas, preserves empty and missing-field object behavior, 
and checks strict-mode errors.
   
   # Are there any significant user-facing changes?
   
   This fixes observable null and cast-error behavior for conversions from 
shredded Variant values to Arrow structs; no API changes are introduced.
   
   OpenAI Codex assisted with investigating the bug and generating the 
implementation and regression tests; I reviewed the changes and verified them.


-- 
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]

Reply via email to