kbendick commented on code in PR #4716:
URL: https://github.com/apache/iceberg/pull/4716#discussion_r876217105
##########
core/src/main/java/org/apache/iceberg/MetadataUpdateParser.java:
##########
@@ -271,5 +378,51 @@ private static MetadataUpdate readAddSortOrder(JsonNode
node) {
UnboundSortOrder sortOrder = SortOrderParser.fromJson(sortOrderNode);
return new MetadataUpdate.AddSortOrder(sortOrder);
}
+
+ private static MetadataUpdate readSetDefaultSortOrder(JsonNode node) {
+ int sortOrderId = JsonUtil.getInt(SORT_ORDER_ID, node);
+ return new MetadataUpdate.SetDefaultSortOrder(sortOrderId);
+ }
+
+ private static MetadataUpdate readAddSnapshot(JsonNode node) {
+ Snapshot snapshot = SnapshotParser.fromJson(null, node);
+ return new MetadataUpdate.AddSnapshot(snapshot);
+ }
+
+ 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: %o", snapshotIds);
Review Comment:
I just checked in JShell and using `%s` directly worked. Will update.
```
jshell> String.format("Format Set<Integer> with o: %o", s);
| Exception java.util.IllegalFormatConversionException: o !=
java.util.ImmutableCollections$SetN
| at Formatter$FormatSpecifier.failConversion (Formatter.java:4426)
| at Formatter$FormatSpecifier.printInteger (Formatter.java:2938)
| at Formatter$FormatSpecifier.print (Formatter.java:2892)
| at Formatter.format (Formatter.java:2673)
| at Formatter.format (Formatter.java:2609)
| at String.format (String.java:2897)
| at (#7:1)
jshell> String.format("Format Set<Integer> with s: %s", s);
$10 ==> "Format Set<Integer> with s: [1, 2, 3]"
```
--
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]