luoyuxia commented on code in PR #22839: URL: https://github.com/apache/flink/pull/22839#discussion_r1259063263
########## flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/StagedSinkModifyOperation.java: ########## @@ -0,0 +1,88 @@ +/* + * 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.flink.table.operations; + +import org.apache.flink.annotation.Internal; +import org.apache.flink.table.catalog.ContextResolvedTable; +import org.apache.flink.table.connector.sink.DynamicTableSink; +import org.apache.flink.table.connector.sink.abilities.SupportsStaging; + +import javax.annotation.Nullable; + +import java.util.Map; + +/** + * DML operation that tells to write to a sink which implements {@link SupportsStaging}. Currently. + * this operation is only for CTAS(CREATE TABLE AS SELECT) statement. + * + * <p>StagedSinkModifyOperation is an extension of SinkModifyOperation in the atomic CTAS scenario. + * Whiling checking whether the corresponding sink support atomic CTAS or not, we will need to get + * DynamicTableSink firstly and check whether it implements {@link SupportsStaging} and then call + * the method {@link SupportsStaging#applyStaging}. We maintain the DynamicTableSink in this + * operation so that we can reuse this DynamicTableSink instead of creating a new DynamicTableSink + * during translate the operation again which is error-prone. Review Comment: nit ```suggestion * during translating the operation again which is error-prone. ``` -- 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]
