-
Notifications
You must be signed in to change notification settings - Fork 786
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
Impl FromIterator for Decimal256Array #2247
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2247 +/- ##
=======================================
Coverage 82.30% 82.31%
=======================================
Files 240 241 +1
Lines 62436 62469 +33
=======================================
+ Hits 51391 51422 +31
- Misses 11045 11047 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. |
arrow/src/array/array_decimal.rs
Outdated
|
||
let mut null_buf = BooleanBufferBuilder::new(size_hint); | ||
|
||
let mut buffer = MutableBuffer::from_len_zeroed(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.
It might be better to create this with the required capacity (not zero-ed) up front
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.
Changed to with_capacity
.
arrow/src/array/array_decimal.rs
Outdated
|
||
/// The default precision and scale used when not specified. | ||
fn default_type() -> DataType { | ||
// Keep maximum precision |
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.
Could we make the default_type
to be a const
value or const
function? As it could be computed at compile time.
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.
trait function cannot be const
. I changed it to be a const
value.
{ | ||
let data = unsafe { | ||
ArrayData::new_unchecked( | ||
U::default_type(), |
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.
Do we need to add the validation with precision/scale to change the default precision/scale for the Decimal256Array like Decimal128Array?
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.
FromIterator for Decimal128Array doesn't validate with precision/scale. It uses default precision and scale.
Benchmark runs are scheduled for baseline = cd45ecb and contender = bde749e. bde749e is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #2248.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?