Skip to content

perf(arrow): build repeated boolean columns with BooleanBuffer - #3178

Open
anoopj wants to merge 1 commit into
apache:mainfrom
anoopj:perf-repeated-bool-buffer
Open

perf(arrow): build repeated boolean columns with BooleanBuffer#3178
anoopj wants to merge 1 commit into
apache:mainfrom
anoopj:perf-repeated-bool-buffer

Conversation

@anoopj

@anoopj anoopj commented Sep 8, 2026

Copy link
Copy Markdown
Member

What changes are included in this PR?

This is similar to #3177 but for constant columns.

create_primitive_array_repeated built a constant boolean column with BooleanArray::from(vec![*value; n]), which allocates an n-byte Vec and then bit-packs it. Set or clear the bits directly with BooleanBuffer::new_set / new_unset instead. The sibling string and binary arms already skip the throwaway Vec via from_iter_values, so this just brings the bool arm in line.

Same output, no nulls. This path materializes constant columns (partition values, defaults, metadata) on read, and boolean constants are uncommon, so it's a minor win.

Are these changes tested?

Covered by existing tests

create_primitive_array_repeated built a constant boolean column with
BooleanArray::from(vec![*value; n]), which allocates an n-byte Vec<bool> and
then bit-packs it. Set or clear the bits directly with BooleanBuffer::new_set
/ new_unset instead. The sibling string and binary arms already skip the
throwaway Vec via from_iter_values, so this just brings the bool arm in line.

Same output, no nulls. This path materializes constant columns (partition
values, defaults, metadata) on read, and boolean constants are uncommon, so
it's a minor win.

@Fokko Fokko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants