aokolnychyi commented on code in PR #50197:
URL: https://github.com/apache/spark/pull/50197#discussion_r2021420967


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/ResolveDefaultColumnsUtil.scala:
##########
@@ -243,6 +243,17 @@ object ResolveDefaultColumns extends QueryErrorsBase
     getDefaultValueExprOrNullLit(field, useNullAsDefault)
   }
 
+  def generateSQL(defaultValue: DefaultValue): String = {
+    if (defaultValue.getSql != null) {
+      defaultValue.getSql
+    } else {
+      ExpressionConverter.toV1(defaultValue.getExpression) match {
+        case Some(e) if !e.isInstanceOf[NonSQLExpression] => e.sql

Review Comment:
   I was thinking about this too. I updated `ResolveDefaultColumns` to accept 
an expression. 



-- 
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