puchengy commented on code in PR #9242:
URL: https://github.com/apache/iceberg/pull/9242#discussion_r1419414744


##########
spark/v3.5/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestRewriteManifestsProcedure.java:
##########
@@ -331,4 +331,33 @@ public void testReplacePartitionField() {
             row(1, Timestamp.valueOf("2022-01-01 10:00:00"), 
Date.valueOf("2022-01-01"))),
         sql("SELECT * FROM %s WHERE ts < current_timestamp()", tableName));
   }
+
+  @Test
+  public void testWriteManifestWithSpecId() {
+    sql(
+        "CREATE TABLE %s (id int, dt string, hr string) USING iceberg 
PARTITIONED BY (dt)",
+        tableName);
+
+    sql("INSERT INTO %s VALUES (1, '2024-01-01', '00')", tableName);
+    sql("INSERT INTO %s VALUES (2, '2024-01-01', '00')", tableName);
+    assertEquals(
+        "Should have 2 manifests",
+        ImmutableList.of(row(2L)),
+        sql("SELECT count(*) FROM %s.manifests", tableName));
+
+    sql("ALTER TABLE %s ADD PARTITION FIELD hr", tableName);

Review Comment:
   Addressed comment.



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