You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "epsio-banay (via GitHub)" <gi...@apache.org> on 2023/09/12 12:22:06 UTC

[GitHub] [arrow-datafusion] epsio-banay opened a new pull request, #7529: Skip EliminateCrossJoin rule if inner join with filter is found - che…

epsio-banay opened a new pull request, #7529:
URL: https://github.com/apache/arrow-datafusion/pull/7529

   …ck recursively
   
   ## 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 these changes tested?
   
   <!--
   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] jackwener commented on pull request #7529: Skip EliminateCrossJoin rule if inner join with filter is found - che…

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on PR #7529:
URL: https://github.com/apache/arrow-datafusion/pull/7529#issuecomment-1717963701

   Thanks @epsio-banay , good catch.
   
   I will review this PR carefully tomorrow.
   
   BTW, I'm thinking about this whole method. I think we don't need differentiate between handling equal conditions and non-equal conditions, because multi join is a Query Graph, both equal conditions and non-equal conditions are edges in Graph. But I also think this is a longer -term problem.
   
   
   


-- 
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 #7529: fix: skip EliminateCrossJoin rule if inner join with filter is found

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #7529:
URL: https://github.com/apache/arrow-datafusion/pull/7529


-- 
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] jackwener commented on pull request #7529: fix: skip EliminateCrossJoin rule if inner join with filter is found

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on PR #7529:
URL: https://github.com/apache/arrow-datafusion/pull/7529#issuecomment-1718006226

   #7549 to trace it


-- 
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 #7529: fix: skip EliminateCrossJoin rule if inner join with filter is found

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7529:
URL: https://github.com/apache/arrow-datafusion/pull/7529#issuecomment-1720065308

   🤔   would a multi-join work for a query like
   
   ```sql
   SELECT ..
     FROM A JOIN B ON (a.x=b.x)
        JOIN C ON (a.y = c.y AND b.z = c.z)
   ```
   
   A join graph might look like this
   
   ```
   (A) -- y -- (B)
      \       /
       x     z
        \   /
         (C)
   ```
   
   Would a multi-join look like
   ```
   JOIN (a.x=b.x, a.y=c.y, b.z=c.z)
     (A, B, C)
   ```
   
   I guess then any reordering could happen as a translation from Multi-join to binary join 🤔 


-- 
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 #7529: fix: skip EliminateCrossJoin rule if inner join with filter is found

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7529:
URL: https://github.com/apache/arrow-datafusion/pull/7529#issuecomment-1717993123

   >  because multi join is a Query Graph and both equal conditions and non-equal conditions are edges in Graph. But I also think this is a longer-term problem. I prepare to do this job in 1-2 weeks.
   
   Representing the joins in a query as a JoinGraph would be very interesting. I wonder if you have an idea of where would it be done? 
   
   It could be as a pass prior to the LogicalPlan:
   ```
   sql text --> Sql AST --> JoinGraph --> LogicalPlan
   ```
   
   or you could do it as part of an optimization pass,  like  this:
   
   ```
   sql text --> Sql AST  --> LogicalPlan --(optimize with JoinGraph) --> LogicalPlan
   ```
   


-- 
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] jackwener commented on pull request #7529: fix: skip EliminateCrossJoin rule if inner join with filter is found

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on PR #7529:
URL: https://github.com/apache/arrow-datafusion/pull/7529#issuecomment-1718010092

   > Representing the joins in a query as a JoinGraph would be very interesting. I wonder if you have an idea of where would it be done?
   
   Because we just want to rearrange `Inner/Outer join`, Use `MultiJoin` is enough.
   
   ```
             MultiJoin
          /    |    |    \
   child   child   child   child .....
   ```


-- 
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 #7529: fix: skip EliminateCrossJoin rule if inner join with filter is found

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7529:
URL: https://github.com/apache/arrow-datafusion/pull/7529#issuecomment-1717993630

   Thanks @epsio-banay  and @jackwener 


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