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..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 @@ -22,6 +22,7 @@ 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; @@ -117,7 +118,9 @@ 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())))); private final FileStoreTable storeTable; @@ -435,7 +438,16 @@ 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()); + }, }; 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..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 @@ -222,7 +222,9 @@ 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)); } return expectedRow; }