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


##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -1387,6 +1387,12 @@
     ],
     "sqlState" : "42623"
   },
+  "COLUMN_DEFAULT_VALUE_IS_NOT_FOLDABLE_OR_RESOLVED" : {
+    "message" : [
+      "The existence default value must be a simple SQL string that is 
resolved and foldable, but column <colName> has default value: (<defaultValue>)"

Review Comment:
   Not sure what `existence default value` means here, I think it is more clear 
if it is just `default value`.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/CatalogV2Util.scala:
##########
@@ -525,10 +525,21 @@ private[sql] object CatalogV2Util {
     }
 
     if (isDefaultColumn) {
-      val e = analyze(f, EXISTS_DEFAULT_COLUMN_METADATA_KEY)
-      assert(e.resolved && e.foldable,
-        "The existence default value must be a simple SQL string that is 
resolved and foldable, " +
-          "but got: " + f.getExistenceDefaultValue().get)
+      val e = analyze(
+        f,
+        statementType = "",

Review Comment:
   Why are we leaving `stetementType` empty? We don't know the statement here, 
is that why?



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