cloud-fan commented on code in PR #54126:
URL: https://github.com/apache/spark/pull/54126#discussion_r2838206600
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/ColumnDefinition.scala:
##########
@@ -273,3 +291,90 @@ case class DefaultValueExpression(
throw QueryCompilationErrors.defaultValueNotConstantError(statement,
colName, originalSQL)
}
}
+
+/**
+ * A wrapper expression to hold the generation expression and its original SQL
text.
+ * The child expression is resolved by the normal analyzer rules through the
expression tree.
+ */
+case class GeneratedColumnExpression(
+ child: Expression,
+ originalSQL: String)
+ extends UnaryExpression with Unevaluable {
+
+ override def dataType: DataType = child.dataType
+
+ override def stringArgs: Iterator[Any] = Iterator(child, originalSQL)
+
+ override protected def withNewChildInternal(newChild: Expression):
Expression =
+ copy(child = newChild)
+
+ /**
+ * Validate the generation expression and throw an AnalysisException if
invalid.
+ * Validations include:
Review Comment:
what's the main difference between this validation and column default
expression validation?
--
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]