-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve Error Handling and Readibility for downcasting Decimal128Array
#4168
Improve Error Handling and Readibility for downcasting Decimal128Array
#4168
Conversation
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.
Thank you for these changes, much appreciated!
I saw two issues with code style/structure and left inline comments. I think your other PRs may have similar issues in them too. It would be great if you can improve code quality by applying these suggestions to those code pieces too.
Short PRs are typically preferable to long PRs, but IMO this is a case where the opposite is true. Since the same kind of work was broken down to many PRs, the suggestions you get in one of those PRs will probably end up being applicable to many of them. Therefore, it sometimes is better to have one cohesive PR in cases like this.
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.
Thank you @retikulum . While I agree with @ozankabak 's suggestions I also think this PR is an improvement over the current state of the code so I would also be happy to merge it in as is.
Please let me know if you would like to continue to improve it or if I should plan to merge as is
Thanks for review @ozankabak. These recommendations are great for improving code quality. I will change the suggested pieces. However, I was confused with PR sizes. While we discussed implementation in the issue, @alamb also suggested that these PRs should be small ( but he suggested a few functions unlike my one function per PR). Rather than implementing one function at one PR, it seems better to implement 3-5 (or more) functions for a PR. My next PRs will include more function implementation. |
Thanks for the feedback. I will change suggested parts and resolve conflicts tomorrow then it will be ready to merge. |
Great, happy to help!
This is basically what I meant as well. This kind of grouping makes sense for PRs like this. |
Yeah there is no specific rule here. Basically I have found the smaller your PRs the easier it will be to find enough someone with enough contiguous time to review them. For larger PRs (e.g. 500+ lines) I often need to spend 30-60 minutes to properly review them and finding blocks of time like that for me is much harder than finding 5-10 minutes for smaller PRs |
Thanks again @retikulum |
Benchmark runs are scheduled for baseline = 5883e43 and contender = f2f8465. f2f8465 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?
Part of #3152.
Rationale for this change
It is very clear in the issue but there are different schemas while downcasting an ArrayRef to a related arrow array type. This is the new PR of improving downcasting to
Decimal128Array
What changes are included in this PR?
as_decimal128_array
is created indatafusion\common\src\cast.rs
get_decimal_value_from_array
functions return typeScalarValue
toResult<ScalarValue>
dyn_cmp_dict
is added todatafusion\physical-expr\Cargo.toml
for passingtest_dictionary_type_to_array_coersion
. Before adding to this, following error was returned.Are there any user-facing changes?
I am not sure about it.