rdblue commented on code in PR #10755:
URL: https://github.com/apache/iceberg/pull/10755#discussion_r1905832698


##########
core/src/main/java/org/apache/iceberg/UpdateRequirements.java:
##########
@@ -173,6 +175,27 @@ private void update(MetadataUpdate.SetDefaultSortOrder 
unused) {
       }
     }
 
+    private void update(MetadataUpdate.RemovePartitionSpecs unused) {
+      // require that the default partition spec has not changed
+      if (!setSpecId) {
+        if (base != null && !isReplace) {
+          require(new 
UpdateRequirement.AssertDefaultSpecID(base.defaultSpecId()));
+        }
+        this.setSpecId = true;
+      }
+
+      // require that no branches have changed, so that old specs won't be 
written.
+      if (base != null && !isReplace) {
+        base.refs()
+            .forEach(
+                (name, ref) -> {
+                  if (ref.isBranch() && !name.equals(SnapshotRef.MAIN_BRANCH)) 
{
+                    require(new UpdateRequirement.AssertRefSnapshotID(name, 
ref.snapshotId()));

Review Comment:
   I think this would have to be injected by the adapter. Probably okay not to 
add it in this PR.



-- 
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]

Reply via email to