-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-12503] [SQL] Pushing Limit Through Union All #10451
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
Changes from 1 commit
01e4cdf
6835704
9180687
b38a21e
d2b84af
fda8025
ac0dccd
6e0018b
0546772
b37a64f
661260b
2dfa0fd
d929d9b
4070d2f
38dcfb2
cb3fc83
8dbacc7
41b9172
56fd782
b5ac8d7
77105e3
7f25d91
ae59f42
3ccf3bd
004ed66
6998ec9
09a5672
358d62e
2823a57
10d570c
cfbeea7
ca5c104
56f0c16
62d5cbe
7cf955f
7899312
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,6 +153,15 @@ object SetOperationPushDown extends Rule[LogicalPlan] with PredicateHelper { | |
| ) | ||
| ) | ||
|
|
||
| // Push down limit into union | ||
| case Limit(exp, Union(left, right)) => | ||
| Limit(exp, | ||
| Union( | ||
| Limit(exp, left), | ||
| Limit(exp, right) | ||
| ) | ||
| ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need a stop condition, or it will keep pushing
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your review! Since we call
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After think it more, there may be a problem: If I think we should have a better way to detect whether we have pushed
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. Let me think about it. Thank you! |
||
|
|
||
| // Push down deterministic projection through UNION ALL | ||
| case p @ Project(projectList, u @ Union(left, right)) => | ||
| if (projectList.forall(_.deterministic)) { | ||
|
|
||
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.
A bug exists here. Will fix it soon. Thanks!