lvyanquan commented on code in PR #6606: URL: https://github.com/apache/paimon/pull/6606#discussion_r2575425360
########## paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/pipeline/cdc/source/TableAwareFileStoreSourceSplit.java: ########## @@ -0,0 +1,154 @@ +/* + * 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.flink.pipeline.cdc.source; + +import org.apache.paimon.catalog.Identifier; +import org.apache.paimon.flink.source.FileStoreSourceSplit; +import org.apache.paimon.schema.TableSchema; +import org.apache.paimon.table.source.Split; +import org.apache.paimon.utils.InstantiationUtil; +import org.apache.paimon.utils.JsonSerdeUtil; + +import org.apache.flink.core.io.SimpleVersionedSerializer; +import org.apache.flink.core.memory.DataInputViewStreamWrapper; +import org.apache.flink.core.memory.DataOutputViewStreamWrapper; + +import javax.annotation.Nullable; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.Objects; + +/** + * A {@link FileStoreSourceSplit} that contains information about the table that corresponds to the + * {@link Split}. + */ +public class TableAwareFileStoreSourceSplit extends FileStoreSourceSplit { + private final Identifier identifier; + @Nullable private final TableSchema lastSchema; + private final TableSchema schema; + + public TableAwareFileStoreSourceSplit( + String id, + Split split, + long recordsToSkip, + Identifier identifier, + @Nullable TableSchema lastSchema, + TableSchema schema) { Review Comment: Although this reduces the size of the state, it results in additional file read operations on the subtask, refer to https://github.com/apache/paimon/blob/87ee257c2d267093cec41c1f95dd58211f2f3347/paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java#L1034. Therefore, it is acceptable to store the schema in the state. -- 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]
