-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-4226] [SQL] Add Exists/In support for where clause #4812
Conversation
Test build #28058 has finished for PR 4812 at commit
|
@chenghao-intel Thank you for your implementation, following are my observations
would be converted as below in case of your implementation I guess
But it syntactically not correct. it supposed to be converted as follow.
Both |
So syntactically, what's the difference between
and
We never select any values from |
Sorry, I meant semantically. |
@marmbrus, any comment on this? |
@chenghao-intel Sorry for late reply. I think semantically it looks fine. |
LGTM |
Hi @chenghao-intel can you rebase this PR? |
// TODO add IN and NOT IN | ||
case whereExpr => | ||
Filter(nodeToExpr(whereExpr), relations) | ||
} |
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.
Seems this do not support sql with both predicts and exists in where clause:
select *
from src b
where
(not exists
(select a.key
from src a
where b.value = a.value and a.key = b.key and a.value > 'val_2'
)
) and b.key > 1
;
I think we can use |
Thank you @liancheng @scwf for the review. I'd like to support the subquery combines filter in where clause in another PR. Probably we can do that after the feature of |
Test build #29829 has finished for PR 4812 at commit
|
Test build #29830 has finished for PR 4812 at commit
|
Test build #30113 has finished for PR 4812 at commit
|
Test build #30114 has finished for PR 4812 at commit
|
Hi @chenghao-intel, thanks for working on this. It seems like this branch has gone stale and there are some questions about the implementation. Can we close this issue for now and discuss design on the JIRA? |
Rewrite the
[NOT] EXISTS
and[NOT] IN
asleft semi join
, to support the subquery in where clause.Some features still need to be supported, but will do another PRs: