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

Zero-copy conversion from Vec to PrimitiveArray #3917

Merged
merged 3 commits into from
Mar 26, 2023

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

Avoids a memory copy

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 23, 2023
@@ -603,7 +603,7 @@ mod tests {
let record_batch =
RecordBatch::try_new(Arc::new(schema), vec![Arc::new(a), Arc::new(b)])
.unwrap();
assert_eq!(record_batch.get_array_memory_size(), 672);
assert_eq!(record_batch.get_array_memory_size(), 628);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is because Vec doesn't round up to a multiple of 64 bytes

@tustvold
Copy link
Contributor Author

tustvold commented Mar 23, 2023

Aah, this breaks the mutable kernels...

Edit: Fixed by #3920

@tustvold tustvold marked this pull request as ready for review March 25, 2023 12:17
@tustvold tustvold force-pushed the zero-copy-primitive-array-from-vec branch from 4b3431b to b8a0a81 Compare March 25, 2023 14:29
@tustvold tustvold requested a review from viirya March 25, 2023 19:06
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