From bcf7b630ef80c63d0836114576154f6fb0990ade Mon Sep 17 00:00:00 2001 From: Liurnly Date: Sun, 15 Dec 2024 15:35:05 +0800 Subject: [PATCH] Spark 3.5: Fix assertion mismatch in PartitionedWritesTestBase/TestRewritePositionDeleteFilesAction (#11748) --- .../spark/actions/TestRewritePositionDeleteFilesAction.java | 4 ++-- .../apache/iceberg/spark/sql/PartitionedWritesTestBase.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java index 3bce399b34a9..21719657d187 100644 --- a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java +++ b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java @@ -275,7 +275,7 @@ public void testRewriteFilter() throws Exception { .execute(); List newDeleteFiles = except(deleteFiles(table), deleteFiles); - assertThat(newDeleteFiles).as("Should have 4 delete files").hasSize(2); + assertThat(newDeleteFiles).as("Delete files").hasSize(2); List expectedRewrittenFiles = filterFiles(table, deleteFiles, ImmutableList.of(1), ImmutableList.of(2)); @@ -469,7 +469,7 @@ public void testRewriteFilterRemoveDangling() throws Exception { .execute(); List newDeleteFiles = except(deleteFiles(table), deleteFiles); - assertThat(newDeleteFiles).as("Should have 2 new delete files").hasSize(0); + assertThat(newDeleteFiles).as("New delete files").hasSize(0); List expectedRewrittenFiles = filterFiles(table, deleteFiles, ImmutableList.of(0), ImmutableList.of(1)); diff --git a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/sql/PartitionedWritesTestBase.java b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/sql/PartitionedWritesTestBase.java index 97f8e6142dc5..88d18113f19c 100644 --- a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/sql/PartitionedWritesTestBase.java +++ b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/sql/PartitionedWritesTestBase.java @@ -53,7 +53,7 @@ public void removeTables() { @TestTemplate public void testInsertAppend() { assertThat(scalarSql("SELECT count(*) FROM %s", selectTarget())) - .as("Should have 5 rows after insert") + .as("Rows before insert") .isEqualTo(3L); sql("INSERT INTO %s VALUES (4, 'd'), (5, 'e')", commitTarget()); @@ -74,7 +74,7 @@ public void testInsertAppend() { @TestTemplate public void testInsertOverwrite() { assertThat(scalarSql("SELECT count(*) FROM %s", selectTarget())) - .as("Should have 5 rows after insert") + .as("Rows before overwrite") .isEqualTo(3L); // 4 and 5 replace 3 in the partition (id - (id % 3)) = 3