Search in sources :

Example 6 with ModifyOperation

use of org.apache.flink.table.operations.ModifyOperation in project flink by apache.

the class TableEnvironmentImpl method extractSinkIdentifierNames.

/**
 * extract sink identifier names from {@link ModifyOperation}s and deduplicate them with {@link
 * #deduplicateSinkIdentifierNames(List)}.
 */
private List<String> extractSinkIdentifierNames(List<ModifyOperation> operations) {
    List<String> tableNames = new ArrayList<>(operations.size());
    for (ModifyOperation operation : operations) {
        if (operation instanceof SinkModifyOperation) {
            String fullName = ((SinkModifyOperation) operation).getContextResolvedTable().getIdentifier().asSummaryString();
            tableNames.add(fullName);
        } else {
            throw new UnsupportedOperationException("Unsupported operation: " + operation);
        }
    }
    return deduplicateSinkIdentifierNames(tableNames);
}
Also used : SinkModifyOperation(org.apache.flink.table.operations.SinkModifyOperation) ArrayList(java.util.ArrayList) ModifyOperation(org.apache.flink.table.operations.ModifyOperation) SinkModifyOperation(org.apache.flink.table.operations.SinkModifyOperation) CollectModifyOperation(org.apache.flink.table.operations.CollectModifyOperation)

Aggregations

ModifyOperation (org.apache.flink.table.operations.ModifyOperation)6 TableException (org.apache.flink.table.api.TableException)4 CollectModifyOperation (org.apache.flink.table.operations.CollectModifyOperation)4 SinkModifyOperation (org.apache.flink.table.operations.SinkModifyOperation)4 ValidationException (org.apache.flink.table.api.ValidationException)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Optional (java.util.Optional)2 CompiledPlan (org.apache.flink.table.api.CompiledPlan)2 ContextResolvedTable (org.apache.flink.table.catalog.ContextResolvedTable)2 FunctionCatalog (org.apache.flink.table.catalog.FunctionCatalog)2 ResolvedCatalogTable (org.apache.flink.table.catalog.ResolvedCatalogTable)2 Operation (org.apache.flink.table.operations.Operation)2 QueryOperation (org.apache.flink.table.operations.QueryOperation)2 StatementSetOperation (org.apache.flink.table.operations.StatementSetOperation)2 File (java.io.File)1 IOException (java.io.IOException)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1