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/04/14 03:52:39 UTC

[GitHub] [arrow-datafusion] liukun4515 opened a new pull request, #2233: support array with scalar arithmetic operation for decimal data type

liukun4515 opened a new pull request, #2233:
URL: https://github.com/apache/arrow-datafusion/pull/2233

   # 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.  
   -->
   
   # 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 `api 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-datafusion] liukun4515 commented on pull request #2233: support array with scalar arithmetic operation for decimal data type

Posted by GitBox <gi...@apache.org>.
liukun4515 commented on PR #2233:
URL: https://github.com/apache/arrow-datafusion/pull/2233#issuecomment-1101944047

   I think It can be merged 


-- 
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-datafusion] liukun4515 commented on a diff in pull request #2233: support array with scalar arithmetic operation for decimal data type

Posted by GitBox <gi...@apache.org>.
liukun4515 commented on code in PR #2233:
URL: https://github.com/apache/arrow-datafusion/pull/2233#discussion_r851859744


##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -280,25 +280,64 @@ where
         .collect()
 }
 
+fn arith_decimal_scalar<F>(

Review Comment:
   But now I find a bug in the arithmetic operation. https://github.com/apache/arrow-datafusion/blob/c91efc27658e58264c4f346a5cfdec8810179e90/datafusion/physical-expr/src/expressions/binary.rs#L302 and https://github.com/apache/arrow-datafusion/blob/c91efc27658e58264c4f346a5cfdec8810179e90/datafusion/physical-expr/src/expressions/binary.rs#L307
   
   In the divide method, we may lose of precision by converting the `i128` to `f64`.
   We use the `f64` to store the larger range of data, but we lose the precision.
   
   I will try to figure out this issue and resolve this.



-- 
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-datafusion] alamb merged pull request #2233: support array with scalar arithmetic operation for decimal data type

Posted by GitBox <gi...@apache.org>.
alamb merged PR #2233:
URL: https://github.com/apache/arrow-datafusion/pull/2233


-- 
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-datafusion] liukun4515 commented on a diff in pull request #2233: support array with scalar arithmetic operation for decimal data type

Posted by GitBox <gi...@apache.org>.
liukun4515 commented on code in PR #2233:
URL: https://github.com/apache/arrow-datafusion/pull/2233#discussion_r851848382


##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -280,25 +280,64 @@ where
         .collect()
 }
 
+fn arith_decimal_scalar<F>(

Review Comment:
   thanks for your reminder and I have a plan to do this.
   



-- 
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-datafusion] alamb commented on pull request #2233: support array with scalar arithmetic operation for decimal data type

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #2233:
URL: https://github.com/apache/arrow-datafusion/pull/2233#issuecomment-1102702975

   Thanks again @liukun4515 


-- 
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-datafusion] alamb commented on a diff in pull request #2233: support array with scalar arithmetic operation for decimal data type

Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #2233:
URL: https://github.com/apache/arrow-datafusion/pull/2233#discussion_r851749656


##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -280,25 +280,64 @@ where
         .collect()
 }
 
+fn arith_decimal_scalar<F>(

Review Comment:
   It would be great to move some / all of this decimal manipulation into the arrow-rs crate at some point



-- 
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-datafusion] alamb commented on pull request #2233: support array with scalar arithmetic operation for decimal data type

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #2233:
URL: https://github.com/apache/arrow-datafusion/pull/2233#issuecomment-1102702781

   > I think It can be merged
   
   
   Sounds good to me -- feel free to do it yourself next time; I normally wait for at least one approving review from a maintainer or active contributor. If the change is trivial I'll merge it then and if a little more involved I try and leave it open for 24 hours. 
   
   


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