brkyvz commented on a change in pull request #34575:
URL: https://github.com/apache/spark/pull/34575#discussion_r748647591



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala
##########
@@ -438,3 +438,70 @@ object VirtualColumn {
   val groupingIdName: String = "spark_grouping_id"
   val groupingIdAttribute: UnresolvedAttribute = 
UnresolvedAttribute(groupingIdName)
 }
+
+/**
+ * The internal representation of the hidden metadata column
+ */
+class MetadataAttribute(
+    override val name: String,
+    override val dataType: DataType,
+    override val nullable: Boolean = true,
+    override val metadata: Metadata = Metadata.empty)(
+    override val exprId: ExprId = NamedExpression.newExprId,
+    override val qualifier: Seq[String] = Seq.empty[String])
+  extends AttributeReference(name, dataType, nullable, metadata)(exprId, 
qualifier) {

Review comment:
       Let's not extend `AttributeReference`, otherwise `copy` can cause issues




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to