Class TableModify

  • All Implemented Interfaces:
    java.lang.Cloneable, RelOptNode, RelNode
    Direct Known Subclasses:
    EnumerableTableModify, JdbcRules.JdbcTableModify, LogicalTableModify

    public abstract class TableModify
    extends SingleRel
    Relational expression that modifies a table.

    It is similar to TableScan, but represents a request to modify a table rather than read from it. It takes one child which produces the modified rows. Those rows are:

    • For INSERT, those rows are the new values;
    • for DELETE, the old values;
    • for UPDATE, all old values plus updated new values.
    • Field Detail

      • table

        protected final RelOptTable table
        The table definition.
      • updateColumnList

        private final java.util.List<java.lang.String> updateColumnList
      • sourceExpressionList

        private final java.util.List<RexNode> sourceExpressionList
      • flattened

        private final boolean flattened
    • Constructor Detail

      • TableModify

        protected TableModify​(RelOptCluster cluster,
                              RelTraitSet traitSet,
                              RelOptTable table,
                              Prepare.CatalogReader catalogReader,
                              RelNode input,
                              TableModify.Operation operation,
                              java.util.List<java.lang.String> updateColumnList,
                              java.util.List<RexNode> sourceExpressionList,
                              boolean flattened)
        Creates a TableModify.

        The UPDATE operation has format like this:

        UPDATE table SET iden1 = exp1, ident2 = exp2  WHERE condition
        Parameters:
        cluster - Cluster this relational expression belongs to
        traitSet - Traits of this relational expression
        table - Target table to modify
        catalogReader - accessor to the table metadata.
        input - Sub-query or filter condition
        operation - Modify operation (INSERT, UPDATE, DELETE)
        updateColumnList - List of column identifiers to be updated (e.g. ident1, ident2); null if not UPDATE
        sourceExpressionList - List of value expressions to be set (e.g. exp1, exp2); null if not UPDATE
        flattened - Whether set flattens the input row type