cloud-fan commented on code in PR #50197: URL: https://github.com/apache/spark/pull/50197#discussion_r2006926675
########## 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: This seems wrong as `NonSQLExpression` can be nested. If we don't allow connectors to return v2 expression as the default value for now, maybe we can fail first and support it later? -- 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