sdf-jkl opened a new pull request, #12092:
URL: https://github.com/apache/arrow-rs/pull/12092

   # Which issue does this PR close?
   
   No issue. This cleans up a wrapper added in #10320.
   
   # Rationale for this change
   
   `unshred_variant` wraps its top-level builder in `TopLevelRowSink`, whose 
only job is to turn `append_null` into `Variant::Null`, because a physical NULL 
cannot go in the non-nullable output `value` column. That takes about 30 lines 
of forwarding code to override one method.
   
   The method it overrides, `VariantValueArrayBuilderExt::append_null`, has no 
other callers in the workspace. `shred_variant` only uses the ext to start an 
object, and writes its nulls through the inherent 
`VariantValueArrayBuilder::append_null`. So the behaviour can live on the 
builder itself.
   
   # What changes are included in this PR?
   
   - `VariantValueArrayBuilderExt::append_null` now appends `Variant::Null`.
   - `TopLevelRowSink` is removed, and `unshred_variant` passes the ext 
directly to the row builders.
   
   `unshred_variant` output does not change. Missing top-level rows still 
become `Variant::Null`, and nested builders keep their own `append_null` 
behaviour: list elements become `Variant::Null` and missing object fields are 
omitted.
   
   # Are these changes tested?
   
   Covered by existing tests, which fail if the ext writes a physical NULL: 
`test_unshred_missing_top_level_value_becomes_variant_null`, 
`test_unshred_missing_row_for_decimal_timestamp_object_list`, 
`test_unshred_value_only_with_unmasked_nulls_materializes_variant_null`, and 
`variant_integration` case 129.
   
   # Are there any significant user-facing changes?
   
   `VariantValueArrayBuilder::builder_ext(..).append_null()` now writes 
`Variant::Null` instead of a physical NULL. Callers building the `value` column 
of a shredded variant should call the inherent 
`VariantValueArrayBuilder::append_null`, which is unchanged. No signatures 
change.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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