Skip to content

Add append_nulls to MapBuilder #9431

@Fokko

Description

@Fokko

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

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   │
└─────────────────────────┴─────────┘

Describe the solution you'd like

Adding append_nulls to MapBuilder.

Describe alternatives you've considered

Calling append(false) in a loop.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrowChanges to the arrow crateenhancementAny new improvement worthy of a entry in the changelog

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions