Package org.apache.calcite.schema.impl
Class ModifiableViewTable
java.lang.Object
org.apache.calcite.schema.impl.AbstractTable
org.apache.calcite.adapter.java.AbstractQueryableTable
org.apache.calcite.schema.impl.ViewTable
org.apache.calcite.schema.impl.ModifiableViewTable
- All Implemented Interfaces:
ModifiableView
,QueryableTable
,Table
,TranslatableTable
,Wrapper
- Direct Known Subclasses:
MockCatalogReader.MockModifiableViewRelOptTable.MockModifiableViewTable
Extension to
ViewTable
that is modifiable.-
Field Summary
Fields inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
elementType
-
Constructor Summary
ConstructorDescriptionModifiableViewTable
(Type elementType, RelProtoDataType rowType, String viewSql, List<String> schemaPath, @Nullable List<String> viewPath, Table table, Path tablePath, RexNode constraint, ImmutableIntList columnMapping) Creates a ModifiableViewTable. -
Method Summary
Modifier and TypeMethodDescriptionfinal ModifiableViewTable
extend
(List<RelDataTypeField> extendedColumns, RelDataTypeFactory typeFactory) Extends the underlying table and returns a new view with updated row-type and column-mapping.protected ModifiableViewTable
extend
(Table extendedTable, RelProtoDataType protoRowType, ImmutableIntList newColumnMapping) Returns the column mapping onto another table.getConstraint
(RexBuilder rexBuilder, RelDataType tableRowType) Returns a constraint that each candidate row must satisfy.getTable()
Returns the underlying table.Returns the full path of the underlying table.<C> @Nullable C
Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.Methods inherited from class org.apache.calcite.schema.impl.ViewTable
asQueryable, getJdbcTableType, getRowType, getSchemaPath, getViewPath, getViewSql, toRel, viewMacro, viewMacro, viewMacro
Methods inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
getElementType, getExpression
Methods inherited from class org.apache.calcite.schema.impl.AbstractTable
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.calcite.schema.Table
getJdbcTableType, getRowType, getStatistic, isRolledUp, rolledUpColumnValidInsideAgg
Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Constructor Details
-
Method Details
-
getConstraint
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 interfaceModifiableView
- Parameters:
rexBuilder
- Rex buildertableRowType
- Row type of the table that this view maps onto
-
getColumnMapping
Description copied from interface:ModifiableView
Returns the column mapping onto another table.mapping[i]
contains the column of the underlying table that thei
th column of the view comes from, or -1 if it is based on an expression.- Specified by:
getColumnMapping
in interfaceModifiableView
-
getTable
Description copied from interface:ModifiableView
Returns the underlying table.- Specified by:
getTable
in interfaceModifiableView
-
getTablePath
Description copied from interface:ModifiableView
Returns the full path of the underlying table.- Specified by:
getTablePath
in interfaceModifiableView
-
unwrap
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 interfaceWrapper
- Overrides:
unwrap
in classAbstractTable
-
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 fieldstypeFactory
- Type factory
-
extend
protected ModifiableViewTable extend(Table extendedTable, RelProtoDataType protoRowType, ImmutableIntList newColumnMapping)
-