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 2023/01/17 12:05:14 UTC

[GitHub] [arrow-datafusion] ygf11 opened a new pull request, #4944: Avoding add outer filter multiple time when transforming exists/in su…

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

   …bquery to join
   
   # 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 #4914.
   
   # 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 these changes tested?
   Yes.
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing 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] ygf11 commented on pull request #4944: Only add outer filter once when transforming exists/in subquery to join

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

   > Looks like the method's comment is out of date. Could you please also fix them in this PR ?
   
   Fixed.


-- 
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] avantgardnerio commented on a diff in pull request #4944: Only add outer filter once when transforming exists/in subquery to join

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


##########
datafusion/optimizer/src/decorrelate_where_exists.rs:
##########
@@ -116,23 +122,27 @@ impl OptimizerRule for DecorrelateWhereExists {
 
 /// Takes a query like:
 ///
-/// ```select c.id from customers c where exists (select * from orders o where o.c_id = c.id)```
+/// SELECT t1.id
+/// FROM t1
+/// WHERE exists
+/// (
+///    SELECT t2.id FROM t2 WHERE t1.id = t2.id
+/// )
 ///
 /// and optimizes it into:
 ///
-/// ```select c.id from customers c
-/// inner join (select o.c_id from orders o group by o.c_id) o on o.c_id = c.c_id```
+/// SELECT t1.id
+/// FROM t1 LEFT SEMI
+/// JOIN t2
+/// ON t1.id = t2.id
 ///
 /// # Arguments
 ///
-/// * subqry - The subquery portion of the `where exists` (select * from orders)
-/// * negated - True if the subquery is a `where not exists`
-/// * filter_input - The non-subquery portion (from customers)
-/// * outer_exprs - Any additional parts to the `where` expression (and c.x = y)
+/// * subqry_info - The subquery and negated(exists/not exists) info.

Review Comment:
   nit: doc does not match parameter name



-- 
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] mingmwang commented on pull request #4944: Only add outer filter once when transforming exists/in subquery to join

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

   > cc @mingmwang, this may be relative to your work #4366.
   
   This PR didn't addressed #4366. I know where the issue is. In this PR, you can just focus on fixing the duplicated Filters bug. 


-- 
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 #4944: Only add outer filter once when transforming exists/in subquery to join

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


-- 
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] mingmwang commented on pull request #4944: Only add outer filter once when transforming exists/in subquery to join

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

   Looks like the method's comment is out of date. Could you please also fix them in this PR ? 
   
   ```rust
   /// # Arguments
   ///
   /// * subqry - The subquery portion of the `where exists` (select * from orders)
   /// * negated - True if the subquery is a `where not exists`
   /// * filter_input - The non-subquery portion (from customers)
   /// * outer_exprs - Any additional parts to the `where` expression (and c.x = y)
   fn optimize_exists(
       query_info: &SubqueryInfo,
       outer_input: &LogicalPlan,
       outer_other_exprs: &[Expr],
   )
   
   ```


-- 
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 #4944: Only add outer filter once when transforming exists/in subquery to join

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

   Thanks @avantgardnerio  and @ygf11 


-- 
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] ygf11 commented on pull request #4944: Only add outer filter once when transforming exists/in subquery to join

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

   cc @mingmwang, this may be relative to your work #4366.


-- 
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 #4944: Only add outer filter once when transforming exists/in subquery to join

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

   Benchmark runs are scheduled for baseline = 22d106a6564345a746699cd5eb1fc84b9267ce83 and contender = e566bfc4af0ffb53717a784ab423d407473b62a0. e566bfc4af0ffb53717a784ab423d407473b62a0 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/044241bbf7bd43bbab0fd1d22d9ff5bf...621768b6e15c4e09a5ba21af06455f7e/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/f58ae74daf734067afb360384290f899...99b304dca9d74ad58a86397457db36c8/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/51ab53df86d64cc08a9bdb0f318de977...a95471e9569c453e84999b23406b7407/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/70b1345bb0a74810b6c5d6f439ad7ac2...192cdd73a8d14570bf3428a4474acf0e/)
   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