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

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new eece085c8 [core] Fix raw convert fail for old storage ro table (#3438)
eece085c8 is described below

commit eece085c86cc481b326a5898f028d96c00088633
Author: Jingsong Lee <[email protected]>
AuthorDate: Thu May 30 14:47:14 2024 +0800

    [core] Fix raw convert fail for old storage ro table (#3438)
---
 .../org/apache/paimon/table/source/MergeTreeSplitGenerator.java    | 3 ++-
 .../src/test/java/org/apache/paimon/io/DataFileTestUtils.java      | 2 +-
 .../java/org/apache/paimon/table/source/SplitGeneratorTest.java    | 7 +++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/paimon-core/src/main/java/org/apache/paimon/table/source/MergeTreeSplitGenerator.java
 
b/paimon-core/src/main/java/org/apache/paimon/table/source/MergeTreeSplitGenerator.java
index 4cf4a1803..c532f85b5 100644
--- 
a/paimon-core/src/main/java/org/apache/paimon/table/source/MergeTreeSplitGenerator.java
+++ 
b/paimon-core/src/main/java/org/apache/paimon/table/source/MergeTreeSplitGenerator.java
@@ -144,6 +144,7 @@ public class MergeTreeSplitGenerator implements 
SplitGenerator {
     }
 
     private boolean withoutDeleteRow(DataFileMeta dataFileMeta) {
-        return dataFileMeta.deleteRowCount().map(count -> count == 
0L).orElse(false);
+        // null to true to be compatible with old version
+        return dataFileMeta.deleteRowCount().map(count -> count == 
0L).orElse(true);
     }
 }
diff --git 
a/paimon-core/src/test/java/org/apache/paimon/io/DataFileTestUtils.java 
b/paimon-core/src/test/java/org/apache/paimon/io/DataFileTestUtils.java
index f31b21f1e..03b9babfa 100644
--- a/paimon-core/src/test/java/org/apache/paimon/io/DataFileTestUtils.java
+++ b/paimon-core/src/test/java/org/apache/paimon/io/DataFileTestUtils.java
@@ -83,7 +83,7 @@ public class DataFileTestUtils {
     }
 
     public static DataFileMeta newFile(
-            String name, int level, int minKey, int maxKey, long maxSequence, 
long deleteRowCount) {
+            String name, int level, int minKey, int maxKey, long maxSequence, 
Long deleteRowCount) {
         return new DataFileMeta(
                 name,
                 maxKey - minKey + 1,
diff --git 
a/paimon-core/src/test/java/org/apache/paimon/table/source/SplitGeneratorTest.java
 
b/paimon-core/src/test/java/org/apache/paimon/table/source/SplitGeneratorTest.java
index 3594a8a78..14faaa671 100644
--- 
a/paimon-core/src/test/java/org/apache/paimon/table/source/SplitGeneratorTest.java
+++ 
b/paimon-core/src/test/java/org/apache/paimon/table/source/SplitGeneratorTest.java
@@ -186,6 +186,13 @@ public class SplitGeneratorTest {
                 .containsExactlyInAnyOrder(
                         Pair.of(Arrays.asList("1", "2", "3", "4", "5"), false),
                         Pair.of(Collections.singletonList("6"), true));
+
+        // test convertible for old version
+        List<DataFileMeta> files6 =
+                Arrays.asList(
+                        newFile("1", 1, 0, 10, 10L, null), newFile("2", 1, 10, 
20, 20L, null));
+        
assertThat(toNamesAndRawConvertible(mergeTreeSplitGenerator.splitForBatch(files6)))
+                .containsExactlyInAnyOrder(Pair.of(Arrays.asList("1", "2"), 
true));
     }
 
     @Test

Reply via email to