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


##########
core/src/test/java/org/apache/iceberg/TestTableUpdatePartitionSpec.java:
##########
@@ -90,6 +90,46 @@ public void testCommitUpdatedSpec() {
     assertThat(table.spec().lastAssignedFieldId()).isEqualTo(1002);
   }
 
+  @TestTemplate
+  public void testCommitFromSpec() {
+    table.updateSpec().addField(bucket("id", 8)).commit();
+
+    // Evolve the spec
+    PartitionSpec evolvedSpec =
+        PartitionSpec.builderFor(table.schema())
+            .withSpecId(1)
+            .bucket("data", 16)
+            .bucket("id", 8, "id_bucket_8")
+            .build();
+    assertThat(table.spec())
+        .as("Should append a partition field to the spec")
+        .isEqualTo(evolvedSpec);
+    assertThat(table.spec().lastAssignedFieldId()).isEqualTo(1001);
+
+    // Restart the spec
+    table
+        .updateSpec()
+        .fromSpec(PartitionSpec.builderFor(table.schema()).build())
+        .addField(bucket("id", 8))
+        .commit();
+
+    V1Assert.assertEquals(
+        "Should soft delete id and data buckets",

Review Comment:
   Isn't this incorrect? Don't we keep the id transform?



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