singhpk234 commented on code in PR #13464:
URL: https://github.com/apache/iceberg/pull/13464#discussion_r2190486260
##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java:
##########
@@ -234,6 +234,13 @@ private static void apply(UpdateSchema pendingUpdate,
TableChange.AddColumn add)
add.isNullable(),
"Incompatible change: cannot add required column: %s",
leafName(add.fieldNames()));
+ if (add.defaultValue() != null) {
+ throw new UnsupportedOperationException(
+ String.format(
+ "Cannot add column %s since default values are currently
unsupported",
+ leafName(add.fieldNames())));
+ }
Review Comment:
Thank you for taking a look ! Agree, this error is specific to iceberg
connector for spark not supporting this feature, brought this up to get your
thoughts on this !
> if there's some standard error code
Presently for REPLACE columns spark throws
```
Expecting actual throwable to be an instance of:
java.lang.UnsupportedOperationException
but was:
org.apache.spark.sql.catalyst.parser.ParseException:
[UNSUPPORTED_DEFAULT_VALUE.WITHOUT_SUGGESTION] DEFAULT column values is not
supported. SQLSTATE: 0A000
== SQL (line 1, position 1) ==
ALTER TABLE t1 REPLACE COLUMNS (x STRING DEFAULT 42)
```
When we throw this presently in iceberg connector way past parsing stage, i
think its at the time of commit throws this, we don't really have much handle
of the parser here ~
--
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]