Skip to content

Commit cb97fc8

Browse files
committed
[core] Fix compile error in DataFilePathFactory
1 parent 6533329 commit cb97fc8

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

paimon-core/src/main/java/org/apache/paimon/io/DataFilePathFactory.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,21 @@ public DataFilePathFactory(
5252
String changelogFilePrefix) {
5353
this.parent = parent;
5454
this.uuid = UUID.randomUUID().toString();
55-
5655
this.pathCount = new AtomicInteger(0);
5756
this.formatIdentifier = formatIdentifier;
5857
this.dataFilePrefix = dataFilePrefix;
5958
this.changelogFilePrefix = changelogFilePrefix;
6059
}
6160

6261
public Path newPath() {
63-
if (!StringUtils.isBlank(dataFilePrefix)) {
62+
if (!StringUtils.isNullOrWhitespaceOnly(dataFilePrefix)) {
6463
return newPath(dataFilePrefix);
6564
}
6665
return newPath(DEFAULT_DATA_FILE_PREFIX);
6766
}
6867

6968
public Path newChangelogPath() {
70-
if (!StringUtils.isBlank(changelogFilePrefix)) {
69+
if (!StringUtils.isNullOrWhitespaceOnly(changelogFilePrefix)) {
7170
return newPath(changelogFilePrefix);
7271
}
7372
return newPath(DEFAULT_CHANGELOG_FILE_PREFIX);

paimon-core/src/main/java/org/apache/paimon/operation/MergeFileSplitRead.java

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@
5656
import java.util.Arrays;
5757
import java.util.Comparator;
5858
import java.util.List;
59-
import java.util.Optional;
6059
import java.util.Set;
6160
import java.util.stream.Collectors;
6261

63-
import static org.apache.paimon.io.DataFilePathFactory.DEFAULT_CHANGELOG_FILE_PREFIX;
6462
import static org.apache.paimon.predicate.PredicateBuilder.containsFields;
6563
import static org.apache.paimon.predicate.PredicateBuilder.splitAnd;
6664

@@ -299,28 +297,12 @@ public RecordReader<KeyValue> createNoMergeReader(
299297
onlyFilterKey ? filtersForKeys : filtersForAll);
300298
List<ReaderSupplier<KeyValue>> suppliers = new ArrayList<>();
301299
for (DataFileMeta file : files) {
302-
suppliers.add(
303-
() -> {
304-
// We need to check extraFiles to be compatible with Paimon 0.2.
305-
// See comments on DataFileMeta#extraFiles.
306-
String fileName = changelogFile(file).orElse(file.fileName());
307-
return readerFactory.createRecordReader(
308-
file.schemaId(), fileName, file.fileSize(), file.level());
309-
});
300+
suppliers.add(() -> readerFactory.createRecordReader(file));
310301
}
311302

312303
return projectOuter(ConcatRecordReader.create(suppliers));
313304
}
314305

315-
private Optional<String> changelogFile(DataFileMeta fileMeta) {
316-
for (String file : fileMeta.extraFiles()) {
317-
if (file.startsWith(DEFAULT_CHANGELOG_FILE_PREFIX)) {
318-
return Optional.of(file);
319-
}
320-
}
321-
return Optional.empty();
322-
}
323-
324306
private RecordReader<KeyValue> projectKey(RecordReader<KeyValue> reader) {
325307
if (keyProjectedFields == null) {
326308
return reader;

0 commit comments

Comments
 (0)