View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.shardingsphere.sqlfederation.optimizer.operator.physical;
19  
20  import org.apache.calcite.adapter.enumerable.EnumerableRel;
21  import org.apache.calcite.adapter.enumerable.EnumerableRelImplementor;
22  import org.apache.calcite.plan.RelOptCluster;
23  import org.apache.calcite.plan.RelOptTable;
24  import org.apache.calcite.plan.RelTraitSet;
25  import org.apache.calcite.prepare.Prepare.CatalogReader;
26  import org.apache.calcite.rel.RelNode;
27  import org.apache.calcite.rel.core.TableModify;
28  import org.apache.calcite.rex.RexNode;
29  
30  import java.util.List;
31  
32  /**
33   * Enumerable modify.
34   */
35  public final class EnumerableModify extends TableModify implements EnumerableRel {
36      
37      public EnumerableModify(final RelOptCluster cluster, final RelTraitSet traitSet, final RelOptTable table, final CatalogReader catalogReader,
38                              final RelNode input, final Operation operation, final List<String> updateColumnList, final List<RexNode> sourceExpressionList, final boolean flattened) {
39          super(cluster, traitSet, table, catalogReader, input, operation, updateColumnList, sourceExpressionList, flattened);
40      }
41      
42      @Override
43      public RelNode copy(final RelTraitSet traitSet, final List<RelNode> inputs) {
44          return new EnumerableModify(getCluster(), traitSet, getTable(), getCatalogReader(), sole(inputs), getOperation(), getUpdateColumnList(), getSourceExpressionList(), isFlattened());
45      }
46      
47      @Override
48      public Result implement(final EnumerableRelImplementor implementor, final Prefer prefer) {
49          // TODO generate modification statements based on dataset and related table information.
50          throw new UnsupportedOperationException();
51      }
52  }