-
Notifications
You must be signed in to change notification settings - Fork 836
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
Remove From
impls that copy data into arrow_buffer::Buffer
#6033
Comments
1000% this, the current hacks of using I had hoped that we would get specialization and be able to fix it this way, but sadly it looks like that is stuck in limbo. As such a breaking change to remove the blanket impl makes sense to me. |
Take |
🤔 we should probably bring the take workflow into this repo from datafusion: https://github.com/apache/datafusion/blob/main/.github/workflows/take.yml |
I believe we have completed this issue now #6043 is merged |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
@XiangpengHao found this on #6031 and I am breaking it into its own ticket
However,
self.buf
isbytes::Bytes
, notarrow_buffer::Bytes
(they confusingly having the same name). The consequence is that the code above will use this From implarrow-rs/arrow-buffer/src/buffer/immutable.rs
Lines 361 to 370 in 3ce8e84
Which results in a copy of data
To avoid the copy, the code is changed to
Describe the solution you'd like
We should do something to prevent future very subtle mistakes (and possibly remove other instances of such mistakes in arrow-rs)
Describe alternatives you've considered
One thing we could do is to remove any
From
impls for Buffer that copy data and instead use an explicit function name. This would make it more explicit when copying was occuring, providing more control and making mistakes such as fixed in #6031 less likelySomething like this, for example
Additional context
The text was updated successfully, but these errors were encountered: