Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: Replace BooleanArray::extend with append_n #13832

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Conversation

comphead
Copy link
Contributor

Which issue does this PR close?

Closes #13144.

Rationale for this change

More concise and potentially more performant API

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the physical-expr Physical Expressions label Dec 18, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me -- thanks @comphead

@comphead comphead merged commit 46101f3 into apache:main Dec 19, 2024
25 checks passed
@comphead
Copy link
Contributor Author

Thanks for the review

self.output_record_batches
.row_indices
.extend(&UInt64Array::from(vec![None; num_rows]));
.append_nulls(num_rows);
self.output_record_batches
.batch_ids
.extend(vec![0; num_rows]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Btw this could avoid some allocation as well (using resize rather than extend based on Vec)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, I'll check if there are other use cases we can modify

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physical-expr Physical Expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use BooleanBuilder::append_n to generate default values in filtered masks
3 participants