@@ -95,21 +95,17 @@ case class UnresolvedFunction(name: String, children: Seq[Expression]) extends E
9595 * Represents all of the input attributes to a given relational operator, for example in
9696 * "SELECT * FROM ...". A [[Star ]] gets automatically expanded during analysis.
9797 */
98- trait Star extends Attribute with trees.LeafNode [Expression ] {
98+ trait Star extends NamedExpression with trees.LeafNode [Expression ] {
9999 self : Product =>
100100
101101 override def name : String = throw new UnresolvedException (this , " name" )
102102 override def exprId : ExprId = throw new UnresolvedException (this , " exprId" )
103103 override def dataType : DataType = throw new UnresolvedException (this , " dataType" )
104104 override def nullable : Boolean = throw new UnresolvedException (this , " nullable" )
105105 override def qualifiers : Seq [String ] = throw new UnresolvedException (this , " qualifiers" )
106+ override def toAttribute : Attribute = throw new UnresolvedException (this , " toAttribute" )
106107 override lazy val resolved = false
107108
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-
113109 // Star gets expanded at runtime so we never evaluate a Star.
114110 override def eval (input : Row = null ): EvaluatedType =
115111 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 {
154150 * @param names the names to be associated with each output of computing [[child ]].
155151 */
156152case class MultiAlias (child : Expression , names : Seq [String ])
157- extends Attribute with trees.UnaryNode [Expression ] {
153+ extends NamedExpression with trees.UnaryNode [Expression ] {
158154
159155 override def name : String = throw new UnresolvedException (this , " name" )
160156
@@ -166,15 +162,9 @@ case class MultiAlias(child: Expression, names: Seq[String])
166162
167163 override def qualifiers : Seq [String ] = throw new UnresolvedException (this , " qualifiers" )
168164
169- override lazy val resolved = false
170-
171- override def newInstance (): MultiAlias = this
165+ override def toAttribute : Attribute = throw new UnresolvedException (this , " toAttribute" )
172166
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
178168
179169 override def eval (input : Row = null ): EvaluatedType =
180170 throw new TreeNodeException (this , s " No function to evaluate expression. type: ${this .nodeName}" )
0 commit comments