dongjoon-hyun commented on code in PR #38823:
URL: https://github.com/apache/spark/pull/38823#discussion_r1116498272


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/GeneratedColumn.scala:
##########
@@ -112,8 +112,10 @@ object GeneratedColumn {
       throw unsupportedExpressionError("subquery expressions are not allowed 
for generated columns")
     }
     // Analyze the parse result
-    // Generated column can't reference itself
-    val relation = new LocalRelation(StructType(schema.filterNot(_.name == 
fieldName)).toAttributes)
+    val allowedBaseColumns = schema
+      .filterNot(_.name == fieldName) // Can't reference itself
+      .filterNot(isGeneratedColumn) // Can't reference other generated columns

Review Comment:
   Shall we add this to the function description after line 74, too?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to