Repository navigation
[Variant] Remove TopLevelRowSink - #12092
Merged
Merged
Conversation
`TopLevelRowSink` only exists to override `append_null` on `VariantValueArrayBuilderExt`, and nothing else calls that method. Make the method write `Variant::Null` directly, so `unshred_variant` no longer needs the forwarding wrapper. `unshred_variant` output does not change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
sdf-jkl
marked this pull request as ready for review
November 9, 2026 21:21
Member
Author
Member
Author
|
@Rich-T-kid a quickie 🙏 😅 |
Member
Author
|
Thank you |
sdf-jkl
added a commit
to peterxcli/arrow-rs
that referenced
this pull request
Nov 20, 2026
…-metadata Resolve the conflict with apache#12092, which removed `TopLevelRowSink`, and switch the tests from `StructArrayBuilder` to `StructArrayAssembler`, which moved to arrow-array in apache#10636. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
No issue. This cleans up a wrapper added in #10320.
Rationale for this change
unshred_variantwraps its top-level builder inTopLevelRowSink, whose only job is to turnappend_nullintoVariant::Null, because a physical NULL cannot go in the non-nullable outputvaluecolumn. 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_variantonly uses the ext to start an object, and writes its nulls through the inherentVariantValueArrayBuilder::append_null. So the behaviour can live on the builder itself.What changes are included in this PR?
VariantValueArrayBuilderExt::append_nullnow appendsVariant::Null.TopLevelRowSinkis removed, andunshred_variantpasses the ext directly to the row builders.unshred_variantoutput does not change. Missing top-level rows still becomeVariant::Null, and nested builders keep their ownappend_nullbehaviour: list elements becomeVariant::Nulland 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, andvariant_integrationcase 129.Are there any significant user-facing changes?
VariantValueArrayBuilder::builder_ext(..).append_null()now writesVariant::Nullinstead of a physical NULL. Callers building thevaluecolumn of a shredded variant should call the inherentVariantValueArrayBuilder::append_null, which is unchanged. No signatures change.🤖 Generated with Claude Code