cloud-fan commented on code in PR #50197: URL: https://github.com/apache/spark/pull/50197#discussion_r2006927752
########## 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: OK we have a test for it. Maybe we should refactor `ResolveDefaultColumns.analyze` and make it accept `Expression` directly. -- 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