gaborkaszab commented on code in PR #12089: URL: https://github.com/apache/iceberg/pull/12089#discussion_r1952759883
########## core/src/main/java/org/apache/iceberg/TableMetadata.java: ########## @@ -1183,6 +1183,21 @@ Builder removeSpecs(Iterable<Integer> specIds) { .filter(s -> !specIdsToRemove.contains(s.specId())) .collect(Collectors.toList()); changes.add(new MetadataUpdate.RemovePartitionSpecs(specIdsToRemove)); + + return this; + } + + Builder removeSchemas(Iterable<Integer> schemaIds) { + Set<Integer> schemaIdsToRemove = Sets.newHashSet(schemaIds); + Preconditions.checkArgument( + !schemaIdsToRemove.contains(currentSchemaId), "Cannot remove the current schema"); + + this.schemas = + schemas.stream() + .filter(s -> !schemaIdsToRemove.contains(s.schemaId())) + .collect(Collectors.toList()); + changes.add(new MetadataUpdate.RemoveSchemas(schemaIdsToRemove)); Review Comment: I prepared another PR for the same RemovePartitionSpecs improvement. Will publish it once this is merged (that also depends on the TestTables change in his PR and not sure how to publish stacked changes as separate PRs TBH) -- 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: issues-unsubscr...@iceberg.apache.org 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