From 442ac8d7ac539d9cd084b149abdc9e41c7334356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=86=E5=AE=87?= Date: Thu, 8 Jan 2026 19:23:30 +0800 Subject: [PATCH 1/2] [core] add data-evolution info to Files System Table. --- .../paimon/table/system/FilesTable.java | 19 +++++++++++++++++-- .../paimon/table/system/FilesTableTest.java | 5 ++++- 2 files changed, 21 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 caa8315eb9ff..881a5d146438 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 @@ -22,11 +22,13 @@ import org.apache.paimon.casting.CastExecutors; import org.apache.paimon.data.BinaryRow; import org.apache.paimon.data.BinaryString; +import org.apache.paimon.data.GenericArray; import org.apache.paimon.data.GenericRow; import org.apache.paimon.data.InternalArray; import org.apache.paimon.data.InternalRow; import org.apache.paimon.data.LazyGenericRow; import org.apache.paimon.disk.IOManager; +import org.apache.paimon.format.blob.BlobFileFormat; import org.apache.paimon.fs.FileIO; import org.apache.paimon.io.DataFileMeta; import org.apache.paimon.io.DataFilePathFactory; @@ -117,7 +119,10 @@ public class FilesTable implements ReadonlyTable { new DataField(14, "max_sequence_number", new BigIntType(true)), new DataField(15, "creation_time", DataTypes.TIMESTAMP_MILLIS()), new DataField(16, "deleteRowCount", DataTypes.BIGINT()), - new DataField(17, "file_source", DataTypes.STRING()))); + new DataField(17, "file_source", DataTypes.STRING()), + new DataField(18, "first_row_id", DataTypes.BIGINT()), + new DataField(19, "write_cols", DataTypes.ARRAY(DataTypes.STRING())), + new DataField(20, "blob", DataTypes.BOOLEAN()))); private final FileStoreTable storeTable; @@ -435,7 +440,17 @@ private LazyGenericRow toRow( () -> file.deleteRowCount().orElse(null), () -> BinaryString.fromString( - file.fileSource().map(FileSource::toString).orElse(null)) + file.fileSource().map(FileSource::toString).orElse(null)), + file::firstRowId, + () -> { + List writeCols = file.writeCols(); + if (writeCols == null) { + return null; + } + return new GenericArray( + writeCols.stream().map(BinaryString::fromString).toArray()); + }, + () -> BlobFileFormat.isBlobFile(file.fileName()) }; 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 343cf236e397..8723cfe0521d 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 @@ -222,7 +222,10 @@ private List getExpectedResult(long snapshotId) { file.creationTime(), file.deleteRowCount().orElse(null), BinaryString.fromString( - file.fileSource().map(Object::toString).orElse(null)))); + file.fileSource().map(Object::toString).orElse(null)), + file.firstRowId(), + null, + false)); } return expectedRow; } From b6276698384eb4079d98fe9bd17b5a64a8821822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=86=E5=AE=87?= Date: Fri, 9 Jan 2026 10:10:19 +0800 Subject: [PATCH 2/2] remove is_blob field --- .../main/java/org/apache/paimon/table/system/FilesTable.java | 5 +---- .../java/org/apache/paimon/table/system/FilesTableTest.java | 3 +-- 2 files changed, 2 insertions(+), 6 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 881a5d146438..b6cae80180ed 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 @@ -28,7 +28,6 @@ import org.apache.paimon.data.InternalRow; import org.apache.paimon.data.LazyGenericRow; import org.apache.paimon.disk.IOManager; -import org.apache.paimon.format.blob.BlobFileFormat; import org.apache.paimon.fs.FileIO; import org.apache.paimon.io.DataFileMeta; import org.apache.paimon.io.DataFilePathFactory; @@ -121,8 +120,7 @@ public class FilesTable implements ReadonlyTable { new DataField(16, "deleteRowCount", DataTypes.BIGINT()), new DataField(17, "file_source", DataTypes.STRING()), new DataField(18, "first_row_id", DataTypes.BIGINT()), - new DataField(19, "write_cols", DataTypes.ARRAY(DataTypes.STRING())), - new DataField(20, "blob", DataTypes.BOOLEAN()))); + new DataField(19, "write_cols", DataTypes.ARRAY(DataTypes.STRING())))); private final FileStoreTable storeTable; @@ -450,7 +448,6 @@ private LazyGenericRow toRow( return new GenericArray( writeCols.stream().map(BinaryString::fromString).toArray()); }, - () -> BlobFileFormat.isBlobFile(file.fileName()) }; 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 8723cfe0521d..b8764800640d 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 @@ -224,8 +224,7 @@ private List getExpectedResult(long snapshotId) { BinaryString.fromString( file.fileSource().map(Object::toString).orElse(null)), file.firstRowId(), - null, - false)); + null)); } return expectedRow; }