KurtYoung commented on a change in pull request #10410: [FLINK-14692][table]support rename/alter table in tableEnvironment in both flink/blink planner URL: https://github.com/apache/flink/pull/10410#discussion_r354095431
########## File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/ddl/AlterTableOperation.java ########## @@ -0,0 +1,83 @@ +/* + * 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.ddl; + +import org.apache.flink.table.catalog.CatalogTable; +import org.apache.flink.table.catalog.ObjectIdentifier; +import org.apache.flink.table.operations.Operation; +import org.apache.flink.table.operations.OperationUtils; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Operation to describe a ALTER TABLE statement. + */ +public class AlterTableOperation implements AlterOperation { + private final ObjectIdentifier tableIdentifier; + private final ObjectIdentifier newTableIdentifier; + private final CatalogTable catalogTable; + private boolean isRename; Review comment: According to sql standard, we will have lots of variant altering operator. I think should prepare for the future changes. We have 2 options here: 1. Use `Enum` here to indicate the actual alter operation, like `RenameTable`, `AddColumn` and so on. But with solution, we might need to put all fields required by different operations into this class. 2. Use class hierarchy to represent alter operations, like have dedicated `RenameTableOperation`, `AddColumnOperation` here. I'm more favor of option #2, WDYT? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
