public class ModifiableViewTable extends ViewTable implements ModifiableView, Wrapper
ViewTable that is modifiable.| Modifier and Type | Class and Description |
|---|---|
private class |
ModifiableViewTable.ModifiableViewTableInitializerExpressionFactory
Initializes columns based on the view constraint.
|
| Modifier and Type | Field and Description |
|---|---|
private ImmutableIntList |
columnMapping |
private RexNode |
constraint |
private InitializerExpressionFactory |
initializerExpressionFactory |
private Table |
table |
private Path |
tablePath |
elementType| Constructor and Description |
|---|
ModifiableViewTable(Type elementType,
RelProtoDataType rowType,
String viewSql,
List<String> schemaPath,
List<String> viewPath,
Table table,
Path tablePath,
RexNode constraint,
ImmutableIntList columnMapping)
Creates a ModifiableViewTable.
|
| Modifier and Type | Method and Description |
|---|---|
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) |
ImmutableIntList |
getColumnMapping()
Returns the column mapping onto another table.
|
RexNode |
getConstraint(RexBuilder rexBuilder,
RelDataType tableRowType)
Returns a constraint that each candidate row must satisfy.
|
private static ImmutableIntList |
getNewColumnMapping(Table underlying,
ImmutableIntList oldColumnMapping,
List<RelDataTypeField> extendedColumns,
RelDataTypeFactory typeFactory)
Creates a mapping from the view index to the index in the underlying table.
|
Table |
getTable()
Returns the underlying table.
|
Path |
getTablePath()
Returns the full path of the underlying table.
|
<C> C |
unwrap(Class<C> aClass)
Finds an instance of an interface implemented by this object,
or returns null if this object does not support that interface.
|
asQueryable, getJdbcTableType, getRowType, getSchemaPath, getViewPath, getViewSql, toRel, viewMacro, viewMacro, viewMacrogetElementType, getExpressiongetStatistic, isRolledUp, rolledUpColumnValidInsideAggclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetJdbcTableType, getRowType, getStatistic, isRolledUp, rolledUpColumnValidInsideAggprivate final Table table
private final Path tablePath
private final RexNode constraint
private final ImmutableIntList columnMapping
private final InitializerExpressionFactory initializerExpressionFactory
public RexNode getConstraint(RexBuilder rexBuilder, RelDataType tableRowType)
ModifiableViewNever null; if there is no constraint, returns "true".
getConstraint in interface ModifiableViewrexBuilder - Rex buildertableRowType - Row type of the table that this view maps ontopublic ImmutableIntList getColumnMapping()
ModifiableViewmapping[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.
getColumnMapping in interface ModifiableViewpublic Table getTable()
ModifiableViewgetTable in interface ModifiableViewpublic Path getTablePath()
ModifiableViewgetTablePath in interface ModifiableViewpublic <C> C unwrap(Class<C> aClass)
Wrapperunwrap in interface Wrapperunwrap in class AbstractTablepublic final ModifiableViewTable extend(List<RelDataTypeField> extendedColumns, RelDataTypeFactory typeFactory)
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.
extendedColumns - Extended fieldstypeFactory - Type factoryprivate static ImmutableIntList getNewColumnMapping(Table underlying, ImmutableIntList oldColumnMapping, List<RelDataTypeField> extendedColumns, RelDataTypeFactory typeFactory)
protected ModifiableViewTable extend(Table extendedTable, RelProtoDataType protoRowType, ImmutableIntList newColumnMapping)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.