-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[CALCITE-4693] Query with Lateral Join should converted to Left Join … #4474
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
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 [email protected] 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 [email protected] list. Thank you for your contributions. |



…When sub-query is aggregate qurey