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/11/03 07:27:11 UTC

[GitHub] [arrow-rs] viirya opened a new pull request, #3009: Check overflow when casting integer to decimal

viirya opened a new pull request, #3009:
URL: https://github.com/apache/arrow-rs/pull/3009

   # 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.
   -->
   
   Part of #2986.
   
   This deals with the case of casting integer to decimal.
   
   # 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.
   -->
   
   # 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] ursabot commented on pull request #3009: Check overflow when casting integer to decimal

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #3009:
URL: https://github.com/apache/arrow-rs/pull/3009#issuecomment-1303099338

   Benchmark runs are scheduled for baseline = 8400b09d2d3f5243d99eba19f85447922dd29575 and contender = 766f69f715faa619077cc5458aef955b627af715. 766f69f715faa619077cc5458aef955b627af715 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/7dbe6d8c129a4fafbd0b261d5642eac7...061d23f6ed264c98bfcd371a4c989e0c/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/0dd8d573f64040bf9b829d5a347eb536...29f06d8e9af544a7beb3b1b62b413f24/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/86664ebd8f6c45fe87906255fd0327c2...d3eb434bb714473680b423264cb3b028/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/13fbfe9aeb0d48b883a975df235e26d3...fa6c18c12b5548419a21268135d58870/)
   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] viirya merged pull request #3009: Check overflow when casting integer to decimal

Posted by GitBox <gi...@apache.org>.
viirya merged PR #3009:
URL: https://github.com/apache/arrow-rs/pull/3009


-- 
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 a diff in pull request #3009: Check overflow when casting integer to decimal

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3009:
URL: https://github.com/apache/arrow-rs/pull/3009#discussion_r1013554960


##########
arrow-array/src/types.rs:
##########
@@ -521,6 +524,10 @@ impl DecimalType for Decimal128Type {
         format_decimal_str(&value.to_string(), precision as usize, scale as usize)
     }
 
+    fn format_decimal_type(precision: u8, scale: u8) -> String {

Review Comment:
   The way we have handled this in other places is an associated const PREFIX



-- 
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 #3009: Check overflow when casting integer to decimal

Posted by GitBox <gi...@apache.org>.
viirya commented on code in PR #3009:
URL: https://github.com/apache/arrow-rs/pull/3009#discussion_r1013589163


##########
arrow-array/src/types.rs:
##########
@@ -521,6 +524,10 @@ impl DecimalType for Decimal128Type {
         format_decimal_str(&value.to_string(), precision as usize, scale as usize)
     }
 
+    fn format_decimal_type(precision: u8, scale: u8) -> String {

Review Comment:
   Changed to `PREFIX` way.



-- 
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 pull request #3009: Check overflow when casting integer to decimal

Posted by GitBox <gi...@apache.org>.
viirya commented on PR #3009:
URL: https://github.com/apache/arrow-rs/pull/3009#issuecomment-1302451110

   > I wonder if the two cast_integer_to_decimal methods could be combined together? 🤔
   
   It's doable. I combined them in latest commit.
   
   


-- 
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 pull request #3009: Check overflow when casting integer to decimal

Posted by GitBox <gi...@apache.org>.
viirya commented on PR #3009:
URL: https://github.com/apache/arrow-rs/pull/3009#issuecomment-1302554879

   Going to fix clippy errors: #3010


-- 
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