RussellSpitzer commented on code in PR #10737:
URL: https://github.com/apache/iceberg/pull/10737#discussion_r1698599115


##########
core/src/main/java/org/apache/iceberg/BaseUpdatePartitionSpec.java:
##########
@@ -66,20 +66,36 @@ class BaseUpdatePartitionSpec implements 
UpdatePartitionSpec {
     this.caseSensitive = true;
     this.base = ops.current();
     this.formatVersion = base.formatVersion();
-    this.spec = base.spec();
+    fromSpec(base.spec());
+  }
+
+  @Override
+  public UpdatePartitionSpec fromSpec(PartitionSpec partitionSpec) {
+    // Clear all changes

Review Comment:
   > Calling Add Identity(X), and then Remove Identity(X) within the same 
UpdatePartitionSpec throws an exception:
   > 
   > ```
   > Cannot delete newly added field: 1001: id: identity(1)
   > java.lang.IllegalArgumentException: Cannot delete newly added field: 1001: 
id: identity(1)
   >    at 
org.apache.iceberg.relocated.com.google.common.base.Preconditions.checkArgument(Preconditions.java:220)
   >    at 
org.apache.iceberg.BaseUpdatePartitionSpec.removeField(BaseUpdatePartitionSpec.java:247)
   > ```
   
   Not in the same command.
   Two commands
   
   Command 1
     Add Identity(id)
     commit()
     
   Command 2
     From unpartitioned
     Add Identity(id)
     commit() // This should fail I think? or be a noop?
   
   



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to