This is an automated email from the ASF dual-hosted git repository.

aokolnychyi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new 504c13428c Spark 3.5: Fix testReplacePartitionField for rewriting 
manifests (#9250)
504c13428c is described below

commit 504c13428cd4ad4d343c644736b957d7f2653b37
Author: bknbkn <[email protected]>
AuthorDate: Sat Dec 9 01:18:56 2023 +0800

    Spark 3.5: Fix testReplacePartitionField for rewriting manifests (#9250)
---
 .../spark/extensions/TestRewriteManifestsProcedure.java | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git 
a/spark/v3.5/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestRewriteManifestsProcedure.java
 
b/spark/v3.5/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestRewriteManifestsProcedure.java
index 8e64eaad44..b230a69129 100644
--- 
a/spark/v3.5/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestRewriteManifestsProcedure.java
+++ 
b/spark/v3.5/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestRewriteManifestsProcedure.java
@@ -316,20 +316,27 @@ public class TestRewriteManifestsProcedure extends 
SparkExtensionsTestBase {
     sql(
         "INSERT INTO %s VALUES (1, CAST('2022-01-01 10:00:00' AS TIMESTAMP), 
CAST('2022-01-01' AS DATE))",
         tableName);
+    sql(
+        "INSERT INTO %s VALUES (2, CAST('2022-01-01 11:00:00' AS TIMESTAMP), 
CAST('2022-01-01' AS DATE))",
+        tableName);
 
     assertEquals(
         "Should have expected rows",
         ImmutableList.of(
-            row(1, Timestamp.valueOf("2022-01-01 10:00:00"), 
Date.valueOf("2022-01-01"))),
-        sql("SELECT * FROM %s WHERE ts < current_timestamp()", tableName));
+            row(1, Timestamp.valueOf("2022-01-01 10:00:00"), 
Date.valueOf("2022-01-01")),
+            row(2, Timestamp.valueOf("2022-01-01 11:00:00"), 
Date.valueOf("2022-01-01"))),
+        sql("SELECT * FROM %s WHERE ts < current_timestamp() order by 1 asc", 
tableName));
 
-    sql("CALL %s.system.rewrite_manifests(table => '%s')", catalogName, 
tableName);
+    List<Object[]> output =
+        sql("CALL %s.system.rewrite_manifests(table => '%s')", catalogName, 
tableName);
+    assertEquals("Procedure output must match", ImmutableList.of(row(2, 1)), 
output);
 
     assertEquals(
         "Should have expected rows",
         ImmutableList.of(
-            row(1, Timestamp.valueOf("2022-01-01 10:00:00"), 
Date.valueOf("2022-01-01"))),
-        sql("SELECT * FROM %s WHERE ts < current_timestamp()", tableName));
+            row(1, Timestamp.valueOf("2022-01-01 10:00:00"), 
Date.valueOf("2022-01-01")),
+            row(2, Timestamp.valueOf("2022-01-01 11:00:00"), 
Date.valueOf("2022-01-01"))),
+        sql("SELECT * FROM %s WHERE ts < current_timestamp() order by 1 asc", 
tableName));
   }
 
   @Test

Reply via email to