Skip to content

Commit

Permalink
change the version judge
Browse files Browse the repository at this point in the history
  • Loading branch information
neuyilan committed Dec 22, 2024
1 parent 1c74139 commit 4f1993f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
12 changes: 2 additions & 10 deletions paimon-core/src/main/java/org/apache/paimon/io/DataFileMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,18 +370,10 @@ public String fileFormat() {
}

@Nullable
public String getDataRootLocationString() {
public String getExternalPath() {
return externalPath;
}

@Nullable
public Path getExternalPath() {
if (externalPath == null) {
return null;
}
return new Path(externalPath);
}

public Optional<FileSource> fileSource() {
return Optional.ofNullable(fileSource);
}
Expand Down Expand Up @@ -568,7 +560,7 @@ public String toString() {
+ "minKey: %s, maxKey: %s, keyStats: %s, valueStats: %s, "
+ "minSequenceNumber: %d, maxSequenceNumber: %d, "
+ "schemaId: %d, level: %d, extraFiles: %s, creationTime: %s, "
+ "deleteRowCount: %d, fileSource: %s, valueStatsCols: %s, dataRootLocation: %s}",
+ "deleteRowCount: %d, fileSource: %s, valueStatsCols: %s, externalPath: %s}",
fileName,
fileSize,
rowCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public InternalRow toRow(DataFileMeta meta) {
meta.embeddedIndex(),
meta.fileSource().map(FileSource::toByteValue).orElse(null),
toStringArrayData(meta.valueStatsCols()),
BinaryString.fromString(meta.getDataRootLocationString()));
BinaryString.fromString(meta.getExternalPath()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ private CommitMessage deserialize(int version, DataInputView view) throws IOExce

private IOExceptionSupplier<List<DataFileMeta>> fileDeserializer(
int version, DataInputView view) {
if (version >= 6) {
if (version >= 5) {
return () -> dataFileSerializer.deserializeList(view);
} else if (version >= 4) {
} else if (version == 4) {
if (dataFileMeta10LegacySerializer == null) {
dataFileMeta10LegacySerializer = new DataFileMeta10LegacySerializer();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@ private static FunctionWithIOException<DataInputView, DataFileMeta> getFileMetaS
} else if (version == 2) {
DataFileMeta09Serializer serializer = new DataFileMeta09Serializer();
return serializer::deserialize;
} else if (version >= 3 && version <= 4) {
} else if (version == 3) {
DataFileMeta10LegacySerializer serializer = new DataFileMeta10LegacySerializer();
return serializer::deserialize;
} else if (version >= 5) {
} else if (version >= 4) {
DataFileMetaSerializer serializer = new DataFileMetaSerializer();
return serializer::deserialize;
} else {
Expand Down

0 comments on commit 4f1993f

Please sign in to comment.