Class ModifiableViewTable

    • Constructor Detail

      • ModifiableViewTable

        public ModifiableViewTable​(java.lang.reflect.Type elementType,
                                   RelProtoDataType rowType,
                                   java.lang.String viewSql,
                                   java.util.List<java.lang.String> schemaPath,
                                   java.util.List<java.lang.String> viewPath,
                                   Table table,
                                   Path tablePath,
                                   RexNode constraint,
                                   ImmutableIntList columnMapping)
        Creates a ModifiableViewTable.
    • Method Detail

      • 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
      • unwrap

        public <C> C unwrap​(java.lang.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​(java.util.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