-
Notifications
You must be signed in to change notification settings - Fork 849
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
Collocate Decimal Array Validation Logic #2446
Collocate Decimal Array Validation Logic #2446
Conversation
Please add some description if this PR has been ready for review. Thank you. |
f0e2a45
to
3929723
Compare
tracked a issue to describe what the pr solves |
.unwrap() | ||
.validate_decimal_precision(precision), | ||
other_width => { | ||
panic!("invalid byte width {}", other_width); |
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 you test that if this is a compile error or a runtime error?
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.
I don't test this error.
Guess this is a runtime error, when use BasicDecimalArray<OTHER_WIDTH>
to call this method.
3929723
to
ed60bbc
Compare
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 makes sense to me, although I do wonder if validation of this form really belongs in ArrayData
.as_any() | ||
.downcast_ref::<Decimal256Array>() | ||
.unwrap() | ||
.validate_decimal_precision(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.
I wonder if this logic should live in ArrayData, where all the rest of the validation logic lives?
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.
some usage of
arrow-rs/arrow/src/array/data.rs
Line 329 in 42e9531
new_self.validate_full().unwrap(); |
arrow-rs/arrow/src/array/data.rs
Line 377 in 42e9531
new_self.validate_full()?; |
arrow-rs/arrow/src/array/data.rs
Line 1037 in 42e9531
pub fn validate_values(&self) -> Result<()> { |
I will go through the usage, and check if it is necessary or not
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.
I'm suggesting that rather than this PR implementing additional validation, it should just use the validation logic that already exists in ArrayData?
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.
sounds great, maybe I can try it in the follow up pr.
we remain the original logic and just refactor this struct and impl now
I just concerned about the performance of the ArrayData
. We have the benchmark which can be used to bench it easily.
@alamb add the validation for decimalarray with_precision_scale
, I also have the same question. Why not we use the logic in the ArrayData
?
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.
Consolidating validation in ArrayData
sounds like a great plan to me. I can't remember any particular reason it isn't there
Benchmark runs are scheduled for baseline = 2185ce2 and contender = 0013170. 0013170 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 #2447
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?