skambha commented on a change in pull request #1325: URL: https://github.com/apache/iceberg/pull/1325#discussion_r470348526
########## File path: spark3/src/main/java/org/apache/iceberg/spark/Spark3Util.java ########## @@ -178,8 +178,12 @@ private static void apply(UpdateSchema pendingUpdate, TableChange.UpdateColumnPo private static void apply(UpdateSchema pendingUpdate, TableChange.AddColumn add) { Type type = SparkSchemaUtil.convert(add.dataType()); - pendingUpdate.addColumn(parentName(add.fieldNames()), leafName(add.fieldNames()), type, add.comment()); - + if (add.isNullable()) { + pendingUpdate.addColumn(parentName(add.fieldNames()), leafName(add.fieldNames()), type, add.comment()); + } else { + pendingUpdate.allowIncompatibleChanges() Review comment: Thanks for the review, @rdblue. Sure, that makes sense. I will update it to throw an error and will use the same error message as SchemaUpdate.addRequiredColumn would have returned without the `allowIncompatibleChanges()`. ie ` Incompatible change: cannot add required column: %s` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org