Skip to content

Wire finish_preserve_values through ArrayBuilder trait#9601

Open
adamreichold wants to merge 1 commit intoapache:mainfrom
adamreichold:finish-preserve-values
Open

Wire finish_preserve_values through ArrayBuilder trait#9601
adamreichold wants to merge 1 commit intoapache:mainfrom
adamreichold:finish-preserve-values

Conversation

@adamreichold
Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

Delta dictionaries require user code to call finish_preserve_values instead of finish on the dictionary builders. But this is generally not possible if those builders are nested within composite builders like lists, maps or structs. Using the new trait method, user code can call this generically which has no effect on e.g. primitive builders due to the default implementation but forwards to this method for composite ones.

What changes are included in this PR?

Adds a new method finish_preserve_values to ArrayBuilder with a default implementation that forwards to finish.

Implements this method for dictionary and composite builders.

Are these changes tested?

Adds tests where new finish_preserve_values inherent methods were created to check that the correct method on the constituent builders is called using a shared mock builder PreserveValuesMock.

Are there any user-facing changes?

This adds a new method finish_preserve_values to the central ArrayBuilder trait, but it has a default implementation so this should be backwards compatible.

To support delta dictionaries for nested builders, this adds a new
method finish_preserve_values to the ArrayBuilder trait and wires
it through to the relevant dictionary and composite builders.
@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to handle delta dictionaries and finish_preserve_values with nested builders

1 participant