haizhou-zhao commented on code in PR #14334:
URL: https://github.com/apache/iceberg/pull/14334#discussion_r2512912980
##########
core/src/main/java/org/apache/iceberg/view/BaseViewOperations.java:
##########
@@ -108,7 +108,7 @@ public void commit(ViewMetadata base, ViewMetadata
metadata) {
// if the metadata is already out of date, reject it
if (base != current()) {
if (base != null) {
- throw new CommitFailedException("Cannot commit: stale view metadata");
+ throw new CommitFailedException("Commit failed: stale view metadata");
Review Comment:
removed
##########
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:
removed
--
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]