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.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 22, 2026
@alamb
Copy link
Copy Markdown
Contributor

alamb commented Mar 27, 2026

@albertlockett I wonder if you might have some time to review this PR and offer an opinion?

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.
@adamreichold adamreichold force-pushed the finish-preserve-values branch from 7e1df01 to 9248def Compare March 28, 2026 06:45
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

2 participants