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

deduplicate variadic buffers in MutableArrayData::extend for ByteView arrays #6808

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

onursatici
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

MutableArrayData adds all variadic buffers from input arrays together, potentially duplicating the same buffers in the output array.

What changes are included in this PR?

extend now checks if the same buffer is added from some other input array and changes the views to be appended to point to the new deduplicated buffer indices

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Nov 27, 2024
@onursatici
Copy link
Contributor Author

@tustvold happy to add tests if this approach is more inline with what you had in mind in #6779

_ => vec![],
let (variadic_data_buffers, buffer_to_idx) = match &data_type {
DataType::BinaryView | DataType::Utf8View => {
let mut buffer_to_idx = HashMap::new();
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if building a hashmap / vec would be overly expensive (though we would need to run benchmarks to be sure)

cc @XiangpengHao

Copy link
Contributor Author

Choose a reason for hiding this comment

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

happy to run benchmarks, any particular in mind or should I create one with criterion specific to this?

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.

2 participants