Class ModifiableViewTable

All Implemented Interfaces:
ModifiableView, QueryableTable, Table, TranslatableTable, Wrapper
Direct Known Subclasses:
MockCatalogReader.MockModifiableViewRelOptTable.MockModifiableViewTable

public class ModifiableViewTable extends ViewTable implements ModifiableView, Wrapper
Extension to ViewTable that is modifiable.
  • Constructor Details

  • Method Details

    • getConstraint

      public RexNode getConstraint(RexBuilder rexBuilder, RelDataType tableRowType)
      Description copied from interface: ModifiableView
      Returns a constraint that each candidate row must satisfy.

      Never null; if there is no constraint, returns "true".

      Specified by:
      getConstraint in interface ModifiableView
      Parameters:
      rexBuilder - Rex builder
      tableRowType - Row type of the table that this view maps onto
    • getColumnMapping

      public ImmutableIntList getColumnMapping()
      Description copied from interface: ModifiableView
      Returns the column mapping onto another table.

      mapping[i] contains the column of the underlying table that the ith column of the view comes from, or -1 if it is based on an expression.

      Specified by:
      getColumnMapping in interface ModifiableView
    • getTable

      public Table getTable()
      Description copied from interface: ModifiableView
      Returns the underlying table.
      Specified by:
      getTable in interface ModifiableView
    • getTablePath

      public Path getTablePath()
      Description copied from interface: ModifiableView
      Returns the full path of the underlying table.
      Specified by:
      getTablePath in interface ModifiableView
    • unwrap

      public <C> @Nullable C unwrap(Class<C> aClass)
      Description copied from interface: Wrapper
      Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.
      Specified by:
      unwrap in interface Wrapper
      Overrides:
      unwrap in class AbstractTable
    • extend

      public final ModifiableViewTable extend(List<RelDataTypeField> extendedColumns, RelDataTypeFactory typeFactory)
      Extends the underlying table and returns a new view with updated row-type and column-mapping.

      The type factory is used to perform some scratch calculations, viz the type mapping, but the "real" row-type will be assigned later, when the table has been bound to the statement's type factory. The is important, because adding types to type factories that do not belong to a statement could potentially leak memory.

      Parameters:
      extendedColumns - Extended fields
      typeFactory - Type factory
    • extend

      protected ModifiableViewTable extend(Table extendedTable, RelProtoDataType protoRowType, ImmutableIntList newColumnMapping)