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
ConstructorsConstructorDescriptionModifiableViewTable(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 ModifiableViewTableextend(List<RelDataTypeField> extendedColumns, RelDataTypeFactory typeFactory) Extends the underlying table and returns a new view with updated row-type and column-mapping.protected ModifiableViewTableextend(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 CFinds 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, viewMacroMethods inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
getElementType, getExpressionMethods inherited from class org.apache.calcite.schema.impl.AbstractTable
getStatistic, isRolledUp, rolledUpColumnValidInsideAggMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.calcite.schema.Table
getJdbcTableType, getRowType, getStatistic, isRolledUp, rolledUpColumnValidInsideAggMethods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Constructor Details
-
Method Details
-
getConstraint
Description copied from interface:ModifiableViewReturns a constraint that each candidate row must satisfy.Never null; if there is no constraint, returns "true".
- Specified by:
getConstraintin interfaceModifiableView- Parameters:
rexBuilder- Rex buildertableRowType- Row type of the table that this view maps onto
-
getColumnMapping
Description copied from interface:ModifiableViewReturns the column mapping onto another table.mapping[i]contains the column of the underlying table that theith column of the view comes from, or -1 if it is based on an expression.- Specified by:
getColumnMappingin interfaceModifiableView
-
getTable
Description copied from interface:ModifiableViewReturns the underlying table.- Specified by:
getTablein interfaceModifiableView
-
getTablePath
Description copied from interface:ModifiableViewReturns the full path of the underlying table.- Specified by:
getTablePathin interfaceModifiableView
-
unwrap
Description copied from interface:WrapperFinds an instance of an interface implemented by this object, or returns null if this object does not support that interface.- Specified by:
unwrapin interfaceWrapper- Overrides:
unwrapin 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)
-