@@ -95,21 +95,17 @@ case class UnresolvedFunction(name: String, children: Seq[Expression]) extends E
95
95
* Represents all of the input attributes to a given relational operator, for example in
96
96
* "SELECT * FROM ...". A [[Star ]] gets automatically expanded during analysis.
97
97
*/
98
- trait Star extends Attribute with trees.LeafNode [Expression ] {
98
+ trait Star extends NamedExpression with trees.LeafNode [Expression ] {
99
99
self : Product =>
100
100
101
101
override def name : String = throw new UnresolvedException (this , " name" )
102
102
override def exprId : ExprId = throw new UnresolvedException (this , " exprId" )
103
103
override def dataType : DataType = throw new UnresolvedException (this , " dataType" )
104
104
override def nullable : Boolean = throw new UnresolvedException (this , " nullable" )
105
105
override def qualifiers : Seq [String ] = throw new UnresolvedException (this , " qualifiers" )
106
+ override def toAttribute : Attribute = throw new UnresolvedException (this , " toAttribute" )
106
107
override lazy val resolved = false
107
108
108
- override def newInstance (): Star = this
109
- override def withNullability (newNullability : Boolean ): Star = this
110
- override def withQualifiers (newQualifiers : Seq [String ]): Star = this
111
- override def withName (newName : String ): Star = this
112
-
113
109
// Star gets expanded at runtime so we never evaluate a Star.
114
110
override def eval (input : Row = null ): EvaluatedType =
115
111
throw new TreeNodeException (this , s " No function to evaluate expression. type: ${this .nodeName}" )
@@ -154,7 +150,7 @@ case class UnresolvedStar(table: Option[String]) extends Star {
154
150
* @param names the names to be associated with each output of computing [[child ]].
155
151
*/
156
152
case class MultiAlias (child : Expression , names : Seq [String ])
157
- extends Attribute with trees.UnaryNode [Expression ] {
153
+ extends NamedExpression with trees.UnaryNode [Expression ] {
158
154
159
155
override def name : String = throw new UnresolvedException (this , " name" )
160
156
@@ -166,15 +162,9 @@ case class MultiAlias(child: Expression, names: Seq[String])
166
162
167
163
override def qualifiers : Seq [String ] = throw new UnresolvedException (this , " qualifiers" )
168
164
169
- override lazy val resolved = false
170
-
171
- override def newInstance (): MultiAlias = this
165
+ override def toAttribute : Attribute = throw new UnresolvedException (this , " toAttribute" )
172
166
173
- override def withNullability (newNullability : Boolean ): MultiAlias = this
174
-
175
- override def withQualifiers (newQualifiers : Seq [String ]): MultiAlias = this
176
-
177
- override def withName (newName : String ): MultiAlias = this
167
+ override lazy val resolved = false
178
168
179
169
override def eval (input : Row = null ): EvaluatedType =
180
170
throw new TreeNodeException (this , s " No function to evaluate expression. type: ${this .nodeName}" )
0 commit comments