-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[CALCITE-4765] Complex correlated EXISTS sub-queries used as scalar subqueries can return wrong results #4724
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
|
@NobiGo If you have time, could you please check if it's working correctly now? Since I couldn't find an |
mihaibudiu
left a comment
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.
The CI is unhappy for some reason too
053b4a9 to
01e4845
Compare
Fixed, thanks! |
|
This is the result compared with PGSQL. |
…ubqueries can return wrong results
01e4845 to
9810a36
Compare
|
I tried constructing |
Is this the right link? |
Sorry, I have updated the original SQL to the SQL in the current PR. |
|
| !} | ||
|
|
||
| !if (use_new_decorr) { | ||
| # TODO: TopDownGeneralDecorrelator should fix trimmer error |
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.
Is anyone working on fixing this?
Should we wait for the fix?
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.
This is an issue of compatibility between the new decorrelator and Trimmer(I think this is a problem we expected). I think we could create a Jira instance to document this problem. Waiting until this issue is fixed before merging this PR is also a good option.
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.
If no one wants to work on it, I will try to fix the problem.
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.
Start by creating a new issue and check with @NobiGo, he has been working on the trimmer recently.
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.
If an issue is created, please @ me.
|
|
||
| !ok | ||
|
|
||
| # [CALCITE-4765] Complex correlated EXISTS sub-queries used as scalar subqueries can return wrong results |
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.
why is blank the right file for this test?
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.
Since no emps table with a commission column was found in quidem test, I need to create one. Alternatively, we can use !use blank in other .iq files.
| !} | ||
|
|
||
| !if (use_new_decorr) { | ||
| # TODO: TopDownGeneralDecorrelator should fix trimmer error |
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.
If an issue is created, please @ me.
| SELECT e2.deptno FROM emps e2 where e1.commission = e2.commission) as table3 | ||
| where table3.deptno <> e1.deptno) | ||
| from emps e1; | ||
| !if (use_old_decorr) { |
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.
Which one is used when running this specific test case?
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 so much for your prompt attention to this issue. It involves new Quidm tests, new TopDownGeneralDecorrelator, and new MARK JOINs. Please feel free to @ me if you'd like to discuss it. @silundong If you have time, you can also look into this issue, because you might understand it better. Thanks!
|
@NobiGo @mihaibudiu I have file a new jira CALCITE-7356 to describe it. |



See CALCITE-4765
Only add tests.