nastra commented on code in PR #16148:
URL: https://github.com/apache/iceberg/pull/16148#discussion_r3168131940
##########
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java:
##########
@@ -1037,6 +1038,50 @@ private static Pair<List<FileScanTask>, String>
planFilesFor(
}
@SuppressWarnings("FutureReturnValueIgnored")
+ private static void applyUpdates(
+ TableMetadata base, TableMetadata.Builder builder, List<MetadataUpdate>
updates) {
+ updates.forEach(
+ update -> {
+ if (update instanceof MetadataUpdate.AddSchema) {
+ Schema schema = ((MetadataUpdate.AddSchema) update).schema();
+ validateSchemaId(base, schema);
+ }
+ update.applyTo(builder);
+ });
+ }
+
+ private static void applyUpdates(
+ ViewMetadata base, ViewMetadata.Builder builder, List<MetadataUpdate>
updates) {
+ updates.forEach(
+ update -> {
+ if (update instanceof MetadataUpdate.AddSchema) {
Review Comment:
validations like these shouldn't be part of applying an update. We do have
requirements that are being executed before applying updates and we check them
in `UpdateRequirements`
--
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]