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/09/27 08:29:26 UTC

[GitHub] [arrow-datafusion] HaoYang670 opened a new pull request, #3625: Fix the simplification of division null.

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

   Signed-off-by: remzi <13...@gmail.com>
   
   # 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 #3624.
   
    # 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.
   -->
   
   Simplify `A / null` and `null / A` to null.
   Add tests.
   
   # 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] codecov-commenter commented on pull request #3625: Fix the simplification of null division.

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #3625:
URL: https://github.com/apache/arrow-datafusion/pull/3625#issuecomment-1259210227

   # [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/3625?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3625](https://codecov.io/gh/apache/arrow-datafusion/pull/3625?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d39703e) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/ea3dbb6fb887b0f58ff113c9b46f743d73c41a67?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ea3dbb6) will **decrease** coverage by `0.08%`.
   > The diff coverage is `58.33%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #3625      +/-   ##
   ==========================================
   - Coverage   86.07%   85.99%   -0.09%     
   ==========================================
     Files         300      300              
     Lines       56337    56457     +120     
   ==========================================
   + Hits        48494    48552      +58     
   - Misses       7843     7905      +62     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/3625?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [datafusion/optimizer/src/simplify\_expressions.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3625/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9vcHRpbWl6ZXIvc3JjL3NpbXBsaWZ5X2V4cHJlc3Npb25zLnJz) | `82.56% <58.33%> (-0.12%)` | :arrow_down: |
   | [datafusion/physical-expr/src/regex\_expressions.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3625/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9waHlzaWNhbC1leHByL3NyYy9yZWdleF9leHByZXNzaW9ucy5ycw==) | `64.38% <0.00%> (-18.66%)` | :arrow_down: |
   | [datafusion/expr/src/window\_frame.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3625/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9leHByL3NyYy93aW5kb3dfZnJhbWUucnM=) | `92.43% <0.00%> (-0.85%)` | :arrow_down: |
   | [datafusion/physical-expr/src/functions.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3625/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9waHlzaWNhbC1leHByL3NyYy9mdW5jdGlvbnMucnM=) | `92.66% <0.00%> (-0.10%)` | :arrow_down: |
   | [datafusion/common/src/scalar.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3625/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9jb21tb24vc3JjL3NjYWxhci5ycw==) | `85.31% <0.00%> (+0.06%)` | :arrow_up: |
   | [datafusion/expr/src/logical\_plan/plan.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3625/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9leHByL3NyYy9sb2dpY2FsX3BsYW4vcGxhbi5ycw==) | `77.42% <0.00%> (+0.16%)` | :arrow_up: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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] HaoYang670 commented on a diff in pull request #3625: Simplify null division.

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


##########
datafusion/optimizer/src/simplify_expressions.rs:
##########
@@ -753,8 +753,14 @@ impl<'a, S: SimplifyInfo> ExprRewriter for Simplifier<'a, S> {
             BinaryExpr {
                 left,
                 op: Divide,
+                right: _,
+            } if is_null(&left) => *left,
+            // null / A --> null
+            BinaryExpr {
+                left: _,
+                op: Divide,
                 right,
-            } if left == right && is_null(&left) => *left,
+            } if is_null(&right) => *right,

Review Comment:
   Thank you for catching this, I will update.



-- 
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] ursabot commented on pull request #3625: Simplify null division.

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

   Benchmark runs are scheduled for baseline = a1b2112c219d4ec67a153de41ea894c68736e9f6 and contender = 6d2b417def2d536e81eb80e082d9cc3ca4e7f5fc. 6d2b417def2d536e81eb80e082d9cc3ca4e7f5fc 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-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/cd722570fd694c53b44a02710a4f3205...8db55863e8e9480fa4d9cab0a1bae106/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/67c9e1e188e148e88d7f1bcd2cf005e7...26ff5ab73a3548eda64a75f2f05dda38/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/7ddb5a7db71c4e6cb3063c93a2ab4b1a...bf4335338c0b48dfa63edf70226f1b5a/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/12465e71d3174a5f91e0fa61815d4011...6a06617b53a94b4aab169a5e075fab14/)
   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-datafusion] alamb commented on a diff in pull request #3625: Simplify null division.

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


##########
datafusion/optimizer/src/simplify_expressions.rs:
##########
@@ -753,8 +753,14 @@ impl<'a, S: SimplifyInfo> ExprRewriter for Simplifier<'a, S> {
             BinaryExpr {
                 left,
                 op: Divide,
+                right: _,
+            } if is_null(&left) => *left,
+            // null / A --> null
+            BinaryExpr {
+                left: _,
+                op: Divide,
                 right,
-            } if left == right && is_null(&left) => *left,
+            } if is_null(&right) => *right,

Review Comment:
   Isn't this checking for `A / null` (not `null / A` as the comments suggest)?
    (as in I think the comments are backwards)



-- 
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] HaoYang670 commented on a diff in pull request #3625: Simplify null division.

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


##########
datafusion/optimizer/src/simplify_expressions.rs:
##########
@@ -753,8 +753,14 @@ impl<'a, S: SimplifyInfo> ExprRewriter for Simplifier<'a, S> {
             BinaryExpr {
                 left,
                 op: Divide,
+                right: _,
+            } if is_null(&left) => *left,
+            // null / A --> null
+            BinaryExpr {
+                left: _,
+                op: Divide,
                 right,
-            } if left == right && is_null(&left) => *left,
+            } if is_null(&right) => *right,

Review Comment:
   Done.



-- 
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 #3625: Simplify null division.

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


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