-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: add new_repeated to ByteArray
#8659
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
feat: add new_repeated to ByteArray
#8659
Conversation
this will be used in: - apache#8653
this will be used to improve performance of converting scalar to array
…peat-helpear-for-bytes-array
new_repeated and try_new_repeated to ByteArraynew_repeated to ByteArray
# Conflicts: # arrow-buffer/src/buffer/mutable.rs
| let s: &[u8] = value.as_ref().as_ref(); | ||
| let value_offsets = OffsetBuffer::from_repeated_length(s.len(), repeat_count); | ||
| let bytes: Buffer = { | ||
| let mut mutable_buffer = MutableBuffer::with_capacity(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 0, do we not know how many elements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the responsibility of the repeat
And 0 will use null pointer so it will no allocate anything unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
Let's get @mbrobbel 's comment addressed and we can merge this in |
|
@alamb this can be merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR include the following PRs changes please make sure to review them first
repeat_slice_n_timestoMutableBuffer#8658Which issue does this PR close?
N/A
Rationale for this change
This will make scalar to array in DataFusion faster
What changes are included in this PR?
Include the changes of:
repeat_slice_n_timestoMutableBuffer#8658Are these changes tested?
yes
Are there any user-facing changes?
yes