Class TableModify

All Implemented Interfaces:
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 Details

    • catalogReader

      protected Prepare.CatalogReader catalogReader
      The connection to the optimizing session.
    • table

      protected final RelOptTable table
      The table definition.
  • Constructor Details

    • TableModify

      protected TableModify(RelOptCluster cluster, RelTraitSet traitSet, RelOptTable table, Prepare.CatalogReader catalogReader, RelNode input, TableModify.Operation operation, @Nullable List<String> updateColumnList, @Nullable 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
    • TableModify

      protected TableModify(RelInput input)
      Creates a TableModify by parsing serialized output.
  • Method Details