-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CALCITE-5939] Support mv rewrite between join types #3381
base: main
Are you sure you want to change the base?
[CALCITE-5939] Support mv rewrite between join types #3381
Conversation
e35afdc
to
73fe67f
Compare
import static org.apache.calcite.plan.expand.SubstitutionRuleUtils.tryMergeParentCalcAndGenResult; | ||
|
||
/** | ||
* Enhancements to joinOnLeftCalcToJoinUnifyRule. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the comments more detailed? It's better to include examples in the comments so that others can understand them easily,the other classes are the same
Please check you PR workflow,there are many failures. |
/** | ||
* Enhancements to joinOnRightCalcToJoinUnifyRule. | ||
*/ | ||
public class ExpandJoinOnRightCalcToJoinUnifyRule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExpandJoinOnRightCalcToJoinUnifyRule,ExpandJoinOnLeftCalcToJoinUnifyRule,ExpandJoinOnCalcToJoinUnifyRule,What is the difference between them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see that there are prototypes of these three rules in the rules that already exist in SubstitutionVisitor, because the unifyRule is an adaptation of the operator to the operator level, so different input structures of Join are treated differently, which you can also reflect in tests
For example, the following two SQL statements correspond to JoinOnLeftCalc and JoinOnRightCalc, respectively
select A.empid, A.deptno, depts.deptno from (select empid, deptno from emps where deptno > 10) A join depts on A.deptno = depts.deptno ;
select A.empid, A.deptno, depts.deptno from depts join (select empid, deptno from emps where deptno > 10) A on depts.deptno = A.deptno ;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your attention to this issue, after some time to verify, I refactored this part of the code, optimized some processes and added more comments, you can reread this code if you're interested @LakeShen
ok,I will fix it in these days |
73fe67f
to
aab3e8d
Compare
Kudos, SonarCloud Quality Gate passed! |
6a4eb9d
to
b88ad8e
Compare
b88ad8e
to
9ff973a
Compare
Quality Gate passedIssues Measures |
No description provided.