xwmr-max commented on code in PR #1399: URL: https://github.com/apache/incubator-paimon/pull/1399#discussion_r1247658426
########## paimon-core/src/main/java/org/apache/paimon/table/system/ManifestsTable.java: ########## @@ -0,0 +1,256 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.table.system; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.Snapshot; +import org.apache.paimon.data.BinaryString; +import org.apache.paimon.data.GenericRow; +import org.apache.paimon.data.InternalRow; +import org.apache.paimon.format.FileFormat; +import org.apache.paimon.fs.FileIO; +import org.apache.paimon.fs.Path; +import org.apache.paimon.manifest.ManifestFileMeta; +import org.apache.paimon.manifest.ManifestList; +import org.apache.paimon.predicate.Predicate; +import org.apache.paimon.reader.RecordReader; +import org.apache.paimon.table.ReadonlyTable; +import org.apache.paimon.table.Table; +import org.apache.paimon.table.source.InnerTableRead; +import org.apache.paimon.table.source.InnerTableScan; +import org.apache.paimon.table.source.ReadOnceTableScan; +import org.apache.paimon.table.source.Split; +import org.apache.paimon.types.BigIntType; +import org.apache.paimon.types.DataField; +import org.apache.paimon.types.RowType; +import org.apache.paimon.utils.FileStorePathFactory; +import org.apache.paimon.utils.IteratorRecordReader; +import org.apache.paimon.utils.ProjectedRow; +import org.apache.paimon.utils.SerializationUtils; +import org.apache.paimon.utils.SnapshotManager; + +import org.apache.paimon.shade.guava30.com.google.common.collect.Iterators; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import static org.apache.paimon.catalog.Catalog.SYSTEM_TABLE_SPLITTER; + +/** A {@link Table} for showing committing snapshots of table. */ +public class ManifestsTable implements ReadonlyTable { + private static final long serialVersionUID = 1L; + + public static final String MANIFESTS = "manifests"; + + public static final RowType TABLE_TYPE = + new RowType( + Arrays.asList( + new DataField(0, "snapshot_id", new BigIntType(false)), Review Comment: hi,Sorry for the delay in replying to you due to internal work. The snapshot_id of the current design is generated by the latest snapshot, which generates all the manifest files. Now that I think about it, this can be confusing. I came up with two options: 1) Change the name of snapshot_id to lastest_snaphot_id to make it clear that this is the latest snapshot 2) List all manifest files, marking which snapshot generated each manifest file, so the snapshot_id here indicates which manifest files were generated. Which one do you think? @JingsongLi -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
