Skip to content

Add append_nulls to MapBuilder#9432

Open
Fokko wants to merge 1 commit intoapache:mainfrom
Fokko:fd-map-append-nulls
Open

Add append_nulls to MapBuilder#9432
Fokko wants to merge 1 commit intoapache:mainfrom
Fokko:fd-map-append-nulls

Conversation

@Fokko
Copy link
Contributor

@Fokko Fokko commented Feb 18, 2026

Which issue does this PR close?

Closes #9431

Rationale for this change

It would be nice to add append_nulls to MapBuilder, similar to append_nulls on GenericListBuilder. Appending the nulls at once, instead of using a loop has some nice performance implications:

Benchmark results (1,000,000 nulls):

┌─────────────────────────┬─────────┐
│         Method          │  Time   │
├─────────────────────────┼─────────┤
│ append(false) in a loop │ 2.36 ms │
├─────────────────────────┼─────────┤
│ append_nulls(N)         │ 50 µs   │
└─────────────────────────┴─────────┘

What changes are included in this PR?

A new public API.

Are these changes tested?

With some fresh unit tests.

Are there any user-facing changes?

A nice and convient new public API

It would be nice to add `append_nulls` to MapBuilder, similar to `append_nulls` on `GenericListBuilder`. Appending the nulls at once, instead of using a loop has some nice performance implications:

Closes apache#9431

```
Benchmark results (1,000,000 nulls):

┌─────────────────────────┬─────────┐
│         Method          │  Time   │
├─────────────────────────┼─────────┤
│ append(false) in a loop │ 2.36 ms │
├─────────────────────────┼─────────┤
│ append_nulls(N)         │ 50 µs   │
└─────────────────────────┴─────────┘
```
@Fokko Fokko force-pushed the fd-map-append-nulls branch from cf19196 to 1b3b079 Compare February 18, 2026 10:12
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.

Add append_nulls to MapBuilder

1 participant

Comments