-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21091][SQL] Move constraint code into QueryPlanConstraints #18298
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
Conversation
| private lazy val aliasMap: AttributeMap[Expression] = AttributeMap( | ||
| expressions.collect { | ||
| case a: Alias => (a.toAttribute, a.child) | ||
| } ++ children.flatMap(_.asInstanceOf[QueryPlanConstraints[PlanType]].aliasMap)) |
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 the only weird part; the rest are straightforward copy.
I couldn't figure out how to get the compiler to past without the explicit cast.
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.
what if we do trait QueryPlanConstraints[PlanType <: QueryPlan[PlanType]] extends QueryPlan[PlanType]?
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.
that would create a cyclic hierarchy ...
|
Test build #78034 has started for PR 18298 at commit |
|
Test build #78039 has finished for PR 18298 at commit
|
|
Test build #3797 has finished for PR 18298 at commit
|
|
retest this please |
|
LGTM |
|
Test build #78061 has finished for PR 18298 at commit
|
| lazy val constraints: ExpressionSet = | ||
| ExpressionSet( | ||
| validConstraints | ||
| .union(inferAdditionalConstraints(constraints)) |
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.
validConstraints
| ExpressionSet( | ||
| validConstraints | ||
| .union(inferAdditionalConstraints(constraints)) | ||
| .union(constructIsNotNullConstraints(constraints)) |
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.
validConstraints
|
Thanks for the cleanup! LGTM modulo Xiao's comment. |
This reverts commit a212b14.
|
LGTM |
|
Merging in master. |
|
Test build #78067 has finished for PR 18298 at commit
|
## What changes were proposed in this pull request? This patch moves constraint related code into a separate trait QueryPlanConstraints, so we don't litter QueryPlan with a lot of constraint private functions. ## How was this patch tested? This is a simple move refactoring and should be covered by existing tests. Author: Reynold Xin <[email protected]> Closes apache#18298 from rxin/SPARK-21091.
What changes were proposed in this pull request?
This patch moves constraint related code into a separate trait QueryPlanConstraints, so we don't litter QueryPlan with a lot of constraint private functions.
How was this patch tested?
This is a simple move refactoring and should be covered by existing tests.