Skip to content

Zero-copy conversion from Vec to PrimitiveArray - #3917

Merged
tustvold merged 3 commits into
apache:masterfrom
tustvold:zero-copy-primitive-array-from-vec
Mar 26, 2023
Merged

tustvold merged 3 commits into
apache:masterfrom
tustvold:zero-copy-primitive-array-from-vec

Conversation

@tustvold

Copy link
Copy Markdown
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
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
Copy Markdown
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

tustvold commented Mar 23, 2023 •

Copy link
Copy Markdown
Contributor Author

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