-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ARROW-3347: [Abandoned] [Rust] Implement PrimitiveArrayBuilder #2648
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2648 +/- ##
==========================================
+ Coverage 87.19% 88.17% +0.97%
==========================================
Files 381 13 -368
Lines 59223 1463 -57760
==========================================
- Hits 51642 1290 -50352
+ Misses 7507 173 -7334
+ Partials 74 0 -74
Continue to review full report at Codecov.
|
Thanks @paddyhoran , and my apologies for being late on ARROW-3089.
I wonder if we can add a |
@sunchao no worries, thanks for the feedback. I think |
Great. Actually I’ve already have an implementation for this. Do you mind if I post a PR for this and review it perhaps? I can create a separate Jira for it. |
Sure, sounds good. |
Closing as there is no need for the byteorder crate dependency when we have |
This is a sub task of ARROW-3089. The scope of this builder is just for types that implement the
ArrowPrimitiveType
trait, i.e.PrimitiveArray
's.There are a number of follow up items that need to be addressed below. I will create JIRA's for these once/if this PR is accepted. I wanted to ensure that others agree with the approach and get some feedback.
The general idea here was to implement the
Write
trait forBuffer
this allowsBuffer
to use theWriteBytesExt
extension trait from the byteorder crate which allowsBuffer
to remain untyped while allowing types that implementArrowPrimitiveType
to be written to aBuffer
instance.The
write_to_buffer
method is then implemented for each primitive type leveraging these extension methods from byteorder. byteorder did not have an implementation forbool
so I had to implement it myself.The builder itself was pretty simple and leverages these other updates.
Follow up items (JIRA's to be created upon merging this PR):
Option<T> where T: ArrowPrimitiveType
From<Vec<T>>
does not do this at the moment and I am testing against it (will be addressed as added in ARROW-3357: [Rust] Add a mutable buffer implementation #2658)add_primitive_array_impl
macro tou8
andi8
(this frustrated me no end...)push
(will be addressed as added in ARROW-3357: [Rust] Add a mutable buffer implementation #2658)cc @kszucs @sunchao @andygrove