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 cb97fc897 [core] Fix compile error in DataFilePathFactory
cb97fc897 is described below

commit cb97fc897f0509fc7049f91924bc9cc314117870
Author: Jingsong <[email protected]>
AuthorDate: Wed Sep 11 14:37:40 2024 +0800

    [core] Fix compile error in DataFilePathFactory
---
 .../org/apache/paimon/io/DataFilePathFactory.java    |  5 ++---
 .../apache/paimon/operation/MergeFileSplitRead.java  | 20 +-------------------
 2 files changed, 3 insertions(+), 22 deletions(-)

diff --git 
a/paimon-core/src/main/java/org/apache/paimon/io/DataFilePathFactory.java 
b/paimon-core/src/main/java/org/apache/paimon/io/DataFilePathFactory.java
index a9006eb99..163efb0e7 100644
--- a/paimon-core/src/main/java/org/apache/paimon/io/DataFilePathFactory.java
+++ b/paimon-core/src/main/java/org/apache/paimon/io/DataFilePathFactory.java
@@ -52,7 +52,6 @@ public class DataFilePathFactory {
             String changelogFilePrefix) {
         this.parent = parent;
         this.uuid = UUID.randomUUID().toString();
-
         this.pathCount = new AtomicInteger(0);
         this.formatIdentifier = formatIdentifier;
         this.dataFilePrefix = dataFilePrefix;
@@ -60,14 +59,14 @@ public class DataFilePathFactory {
     }
 
     public Path newPath() {
-        if (!StringUtils.isBlank(dataFilePrefix)) {
+        if (!StringUtils.isNullOrWhitespaceOnly(dataFilePrefix)) {
             return newPath(dataFilePrefix);
         }
         return newPath(DEFAULT_DATA_FILE_PREFIX);
     }
 
     public Path newChangelogPath() {
-        if (!StringUtils.isBlank(changelogFilePrefix)) {
+        if (!StringUtils.isNullOrWhitespaceOnly(changelogFilePrefix)) {
             return newPath(changelogFilePrefix);
         }
         return newPath(DEFAULT_CHANGELOG_FILE_PREFIX);
diff --git 
a/paimon-core/src/main/java/org/apache/paimon/operation/MergeFileSplitRead.java 
b/paimon-core/src/main/java/org/apache/paimon/operation/MergeFileSplitRead.java
index b30789c43..b08a28b49 100644
--- 
a/paimon-core/src/main/java/org/apache/paimon/operation/MergeFileSplitRead.java
+++ 
b/paimon-core/src/main/java/org/apache/paimon/operation/MergeFileSplitRead.java
@@ -56,11 +56,9 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.List;
-import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import static 
org.apache.paimon.io.DataFilePathFactory.DEFAULT_CHANGELOG_FILE_PREFIX;
 import static org.apache.paimon.predicate.PredicateBuilder.containsFields;
 import static org.apache.paimon.predicate.PredicateBuilder.splitAnd;
 
@@ -299,28 +297,12 @@ public class MergeFileSplitRead implements 
SplitRead<KeyValue> {
                         onlyFilterKey ? filtersForKeys : filtersForAll);
         List<ReaderSupplier<KeyValue>> suppliers = new ArrayList<>();
         for (DataFileMeta file : files) {
-            suppliers.add(
-                    () -> {
-                        // We need to check extraFiles to be compatible with 
Paimon 0.2.
-                        // See comments on DataFileMeta#extraFiles.
-                        String fileName = 
changelogFile(file).orElse(file.fileName());
-                        return readerFactory.createRecordReader(
-                                file.schemaId(), fileName, file.fileSize(), 
file.level());
-                    });
+            suppliers.add(() -> readerFactory.createRecordReader(file));
         }
 
         return projectOuter(ConcatRecordReader.create(suppliers));
     }
 
-    private Optional<String> changelogFile(DataFileMeta fileMeta) {
-        for (String file : fileMeta.extraFiles()) {
-            if (file.startsWith(DEFAULT_CHANGELOG_FILE_PREFIX)) {
-                return Optional.of(file);
-            }
-        }
-        return Optional.empty();
-    }
-
     private RecordReader<KeyValue> projectKey(RecordReader<KeyValue> reader) {
         if (keyProjectedFields == null) {
             return reader;

Reply via email to