ricardopereira33 commented on code in PR #12670:
URL: https://github.com/apache/iceberg/pull/12670#discussion_r2026575558
##########
core/src/main/java/org/apache/iceberg/MetadataUpdateParser.java:
##########
@@ -557,11 +564,18 @@ private static MetadataUpdate readAddSnapshot(JsonNode
node) {
private static MetadataUpdate readRemoveSnapshots(JsonNode node) {
Set<Long> snapshotIds = JsonUtil.getLongSetOrNull(SNAPSHOT_IDS, node);
Preconditions.checkArgument(
- snapshotIds != null && snapshotIds.size() == 1,
- "Invalid set of snapshot ids to remove. Expected one value but
received: %s",
+ snapshotIds != null,
+ "Invalid set of snapshot ids to remove. Expected at least 1 value but
received: %s",
snapshotIds);
- Long snapshotId = Iterables.getOnlyElement(snapshotIds);
- return new MetadataUpdate.RemoveSnapshot(snapshotId);
+ // TODO: Remove condition once RemoveSnapshot is deprecated and removed
+ MetadataUpdate metadataUpdate;
+ if (snapshotIds.size() == 1) {
+ Long snapshotId = Iterables.getOnlyElement(snapshotIds);
+ metadataUpdate = new MetadataUpdate.RemoveSnapshot(snapshotId);
Review Comment:
To keep the same behaviour as before, and to not break existing tests.
--
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]