urosstan-db commented on code in PR #46594:
URL: https://github.com/apache/spark/pull/46594#discussion_r1628263999


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statements.scala:
##########
@@ -142,9 +143,16 @@ case class QualifiedColType(
   def getV2Default: ColumnDefaultValue = {
     default.map { sql =>
       val e = ResolveDefaultColumns.analyze(colName, dataType, sql, "ALTER 
TABLE")
-      assert(e.resolved && e.foldable,
-        "The existence default value must be a simple SQL string that is 
resolved and foldable, " +
-          "but got: " + sql)
+      if (!e.resolved || !e.foldable) {

Review Comment:
   I added isFoldable check to parsed expression. ConstantFolding is plan and 
its expression has alias which is not foldable, so I did check on parsed 
expression. Btw, do we need to check that it is resolved, since if something is 
foldable, that means no column reference are there, and I did not add that 
condition, is that ok?
   



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

Reply via email to