urosstan-db commented on code in PR #46594:
URL: https://github.com/apache/spark/pull/46594#discussion_r1624483152
##########
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 = "",
+ metadataKey = EXISTS_DEFAULT_COLUMN_METADATA_KEY)
+
+ if (!e.resolved || !e.foldable) {
+ throw new AnalysisException(
+ errorClass = "COLUMN_DEFAULT_VALUE_IS_NOT_FOLDABLE_OR_RESOLVED",
+ messageParameters = Map(
+ "colName" -> f.name,
+ "defaultValue" -> f.getExistenceDefaultValue().get,
Review Comment:
Thanks
--
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]