You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/12/03 17:59:58 UTC
[GitHub] [arrow-rs] tustvold opened a new pull request, #3264: Simplify decimal cast logic
tustvold opened a new pull request, #3264:
URL: https://github.com/apache/arrow-rs/pull/3264
_Draft as currently leads to similar performance regressions as #3260, investigating cause_
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #.
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
The logic was extremely complicated and hard to follow, and suffered from a lot of duplication, leading to inconsistencies such as #3224
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!---
If there are any breaking changes to public APIs, please add the `breaking change` label.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] tustvold commented on pull request #3264: Simplify decimal cast logic
Posted by GitBox <gi...@apache.org>.
tustvold commented on PR #3264:
URL: https://github.com/apache/arrow-rs/pull/3264#issuecomment-1336261231
This does represent a performance regression for decimal256 arrays, as previously the logic was incorrectly using i128 arithmetic when it should have been using i256.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] viirya commented on a diff in pull request #3264: Simplify decimal cast logic
Posted by GitBox <gi...@apache.org>.
viirya commented on code in PR #3264:
URL: https://github.com/apache/arrow-rs/pull/3264#discussion_r1038886636
##########
arrow-cast/src/cast.rs:
##########
@@ -381,22 +371,17 @@ where
} else {
array
.try_unary::<_, Decimal128Type, _>(|v| {
- mul.mul_checked(v.as_()).and_then(|value| {
- let mul_v = value.round();
- let integer: i128 = mul_v.to_i128().ok_or_else(|| {
- ArrowError::CastError(format!(
- "Cannot cast to {}({}, {}). Overflowing on {:?}",
- Decimal128Type::PREFIX,
- precision,
- scale,
- v
- ))
- })?;
-
- Ok(integer)
+ (mul * v.as_()).round().to_i128().ok_or_else(|| {
+ ArrowError::CastError(format!(
+ "Cannot cast to {}({}, {}). Overflowing on {:?}",
+ Decimal128Type::PREFIX,
+ precision,
+ scale,
+ v
+ ))
Review Comment:
👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] tustvold merged pull request #3264: Simplify decimal cast logic
Posted by GitBox <gi...@apache.org>.
tustvold merged PR #3264:
URL: https://github.com/apache/arrow-rs/pull/3264
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] ursabot commented on pull request #3264: Simplify decimal cast logic
Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #3264:
URL: https://github.com/apache/arrow-rs/pull/3264#issuecomment-1336419452
Benchmark runs are scheduled for baseline = 09d5f02a0bc76afbe7a764fc11f781f2cceaf4fb and contender = 9f64476d837e834b2616a8b6cd19bbd860defd39. 9f64476d837e834b2616a8b6cd19bbd860defd39 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/a55b3e1491a64d6d9d53fe91f0bc9988...b161369271224a4aa846536ed82b1ac7/)
[Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/05553a23ef634a7fb19a5ab0244b9719...6fa64fc226864d49901c0cdff82b60f4/)
[Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/55a2c6ed89044c71bb2a6419a3be4af3...8e3601a7dc494a5899b19e6cb9b221f4/)
[Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/9e08c83de24f4382aec58bd824675466...638c784737174afc82e8cec3f60e3ff3/)
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] liukun4515 commented on pull request #3264: Simplify decimal cast logic
Posted by GitBox <gi...@apache.org>.
liukun4515 commented on PR #3264:
URL: https://github.com/apache/arrow-rs/pull/3264#issuecomment-1337014089
> This does represent a performance regression for decimal256 arrays, as previously the logic was incorrectly using i128 arithmetic when it should have been using i256. Correctness is more important and we're talking microseconds, so I think this is fine
thanks @tustvold
correctness is more important than performance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org