nastra commented on code in PR #14334:
URL: https://github.com/apache/iceberg/pull/14334#discussion_r2438769372
##########
core/src/main/java/org/apache/iceberg/UpdateRequirement.java:
##########
@@ -230,4 +231,54 @@ public void validate(TableMetadata base) {
}
}
}
+
+ class AssertCurrentViewVersionID implements UpdateRequirement {
+ private final int viewVersionId;
+
+ public AssertCurrentViewVersionID(int viewVersionId) {
+ this.viewVersionId = viewVersionId;
+ }
+
+ public int viewVersionId() {
+ return viewVersionId;
+ }
+
+ @Override
+ public void validate(ViewMetadata base) {
+ if (viewVersionId != base.currentVersionId()) {
+ throw new CommitFailedException(
+ "Requirement failed: current view version changed: expected
version %s != %s",
+ viewVersionId, base.currentVersionId());
+ }
+ }
+ }
+
+ /**
+ * Assuming that view ID is incrementing integers, so the last assigned view
version ID is always
Review Comment:
this isn't something that holds true. View versions are not guaranteed to be
monotonically increasing and the spec doesn't say anything about this
--
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]