cloud-fan commented on code in PR #49942: URL: https://github.com/apache/spark/pull/49942#discussion_r1955382758
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/ColumnDefinition.scala: ########## @@ -75,7 +75,7 @@ case class ColumnDefinition( // For v1 CREATE TABLE command, we will resolve and execute the default value expression later // in the rule `DataSourceAnalysis`. We just need to put the default value SQL string here. metadataBuilder.putString(CURRENT_DEFAULT_COLUMN_METADATA_KEY, default.originalSQL) - metadataBuilder.putString(EXISTS_DEFAULT_COLUMN_METADATA_KEY, default.originalSQL) + metadataBuilder.putString(EXISTS_DEFAULT_COLUMN_METADATA_KEY, default.child.sql) Review Comment: Note that, `Expression#sql` is for display only, and it's not guaranteed to be able to parse back. I think we should only use `child.sql` here if `child` is a literal, which means this `ColumnDefinition` has been resolved and constant-folded. -- 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