szehon-ho commented on a change in pull request #2961:
URL: https://github.com/apache/iceberg/pull/2961#discussion_r687471237
##########
File path: api/src/main/java/org/apache/iceberg/Snapshot.java
##########
@@ -135,4 +135,12 @@
default Integer schemaId() {
return null;
}
+
+ /**
+ * Return the tags associated with the snapshot, or null if no tag is
associated with the snapshot.
Review comment:
Nit: 'if no tags are'
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -966,6 +972,22 @@ private static SortOrder freshSortOrder(int orderId,
Schema schema, SortOrder so
return builder.build();
}
+ private static Map<String, Long> indexAndValidateSnapshotTags(List<Snapshot>
snapshots) {
+ Map<String, Long> snapshotTags = Maps.newHashMap();
+ for (Snapshot snap : snapshots) {
+ if (snap.tags() != null) {
+ for (String tag : snap.tags()) {
+ ValidationException.check(!snapshotTags.containsKey(tag),
+ "Tag is must be assigned to only 1 snapshot, but found tag %s in
snapshots %s and %s",
Review comment:
Nit: unnecessary "is"
Suggestion: "A tag can be assigned to only one snapshot, but ..."
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -238,6 +238,7 @@ public String toString() {
private final long currentSnapshotId;
Review comment:
Do we need to handle all the update snapshot calls? ie,
replaceCurrentSnapshot, addStagedSnashot, etc.
--
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]