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 5844a8940 [core] Show fileSource in the FilesTable (#4443)
5844a8940 is described below
commit 5844a8940dc6aa495a7f7de9ff80a2d7a1ba5f57
Author: WenjunMin <[email protected]>
AuthorDate: Tue Nov 5 14:24:11 2024 +0800
[core] Show fileSource in the FilesTable (#4443)
---
.../main/java/org/apache/paimon/table/system/FilesTable.java | 12 ++++++++++--
.../java/org/apache/paimon/table/system/FilesTableTest.java | 4 +++-
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git
a/paimon-core/src/main/java/org/apache/paimon/table/system/FilesTable.java
b/paimon-core/src/main/java/org/apache/paimon/table/system/FilesTable.java
index ab08d9e9f..53d207812 100644
--- a/paimon-core/src/main/java/org/apache/paimon/table/system/FilesTable.java
+++ b/paimon-core/src/main/java/org/apache/paimon/table/system/FilesTable.java
@@ -27,6 +27,7 @@ import org.apache.paimon.data.LazyGenericRow;
import org.apache.paimon.disk.IOManager;
import org.apache.paimon.io.DataFileMeta;
import org.apache.paimon.io.DataFilePathFactory;
+import org.apache.paimon.manifest.FileSource;
import org.apache.paimon.predicate.Equal;
import org.apache.paimon.predicate.LeafPredicate;
import org.apache.paimon.predicate.LeafPredicateExtractor;
@@ -111,7 +112,8 @@ public class FilesTable implements ReadonlyTable {
12, "max_value_stats",
SerializationUtils.newStringType(false)),
new DataField(13, "min_sequence_number", new
BigIntType(true)),
new DataField(14, "max_sequence_number", new
BigIntType(true)),
- new DataField(15, "creation_time",
DataTypes.TIMESTAMP_MILLIS())));
+ new DataField(15, "creation_time",
DataTypes.TIMESTAMP_MILLIS()),
+ new DataField(16, "file_source",
DataTypes.STRING())));
private final FileStoreTable storeTable;
@@ -413,7 +415,13 @@ public class FilesTable implements ReadonlyTable {
() ->
BinaryString.fromString(statsGetter.upperValueBounds().toString()),
dataFileMeta::minSequenceNumber,
dataFileMeta::maxSequenceNumber,
- dataFileMeta::creationTime
+ dataFileMeta::creationTime,
+ () ->
+ BinaryString.fromString(
+ dataFileMeta
+ .fileSource()
+ .map(FileSource::toString)
+ .orElse(null))
};
return new LazyGenericRow(fields);
diff --git
a/paimon-core/src/test/java/org/apache/paimon/table/system/FilesTableTest.java
b/paimon-core/src/test/java/org/apache/paimon/table/system/FilesTableTest.java
index 89fb201fa..1a692270a 100644
---
a/paimon-core/src/test/java/org/apache/paimon/table/system/FilesTableTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/table/system/FilesTableTest.java
@@ -211,7 +211,9 @@ public class FilesTableTest extends TableTestBase {
maxCol1, maxKey, partition1,
partition2)),
file.minSequenceNumber(),
file.maxSequenceNumber(),
- file.creationTime()));
+ file.creationTime(),
+ BinaryString.fromString(
+
file.fileSource().map(Object::toString).orElse(null))));
}
return expectedRow;
}