-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-9085][SQL] Remove LeafNode, UnaryNode, BinaryNode from TreeNode. #7434
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
|
Test build #37427 has finished for PR 7434 at commit
|
00faa74 to
2225331
Compare
|
cc @marmbrus |
|
Test build #37435 has finished for PR 7434 at commit
|
|
Test build #37439 has finished for PR 7434 at commit
|
|
Test build #37440 has finished for PR 7434 at commit
|
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.
how about:
trait AggregateExpression {
self: Expression =>
}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.
it'd result in a lot more code changes to get it working. e.g.
abstract class AggregateFunction
extends LeafExpression with AggregateExpression with Serializable {
self: Product =>
/** Base should return the generic aggregate expression that this function is computing */
val base: AggregateExpression
override def nullable: Boolean = base.nullable <--- this won't work anymore
override def dataType: DataType = base.dataType|
Test build #37458 has finished for PR 7434 at commit
|
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 remember we set a default parameter value for eval, so we can just write e.eval() here?
|
OK I'm going to merge this. I will try to get rid of the self types in a followup pr. |
Just a small change to add Product type to the base expression/plan abstract classes, based on suggestions on #7434 and offline discussions. Author: Reynold Xin <[email protected]> Closes #7479 from rxin/remove-self-types and squashes the following commits: e407ffd [Reynold Xin] [SPARK-9142][SQL] Removing unnecessary self types in Catalyst.
This builds on #7433 but also removes LeafNode/UnaryNode. These are slightly more complicated to remove. I had to change some abstract classes to traits in order for it to work.
The problem with LeafNode/UnaryNode is that they are often mixed in at the end of an Expression, and then the toString function actually gets resolved to the ones defined in TreeNode, rather than in Expression.