[CALCITE-4693] Query with Lateral Join should converted to Left Join …#4474
[CALCITE-4693] Query with Lateral Join should converted to Left Join …#4474NobiGo wants to merge 3 commits intoapache:mainfrom
Conversation
…When sub-query is aggregate qurey
|
| // lateral (select count(cast(deptno as integer)) from "scott".emp | ||
| // where emp.deptno = dept.deptno) on true; | ||
| SqlJoin sqlJoin = (SqlJoin) node; | ||
| if (sqlJoin.getJoinType() == JoinType.COMMA && sqlJoin.getRight() instanceof SqlCall) { |
There was a problem hiding this comment.
can you explain where the discussion in the JIRA is reflected in this code?
I think the consensus there was that a left join is not always right
There was a problem hiding this comment.
I agree, @mihaibudiu. The jira cases discusses how converting an inner lateral join to a left join is WRONG. Do not merge this PR.
There was a problem hiding this comment.
I will recheck this. This repair method does have some issues. I will add more test cases to verify it.
|
I believe this is not the root cause of the incorrect query results. It's related to #4375. The issue occurs in the Decorrelator. PR-4375 appears to have missed some cases where parentPropagatesNullValues should be set to false when Correlate's joinType is not Left. I'm confident the following modification can fix all tests in this PR. |
I will recheck this. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions. |



…When sub-query is aggregate qurey