Package org.apache.calcite.sql.ddl
Class SqlCreateTable.MutableArrayTable
- java.lang.Object
-
- org.apache.calcite.schema.impl.AbstractTable
-
- org.apache.calcite.sql.ddl.SqlCreateTable.AbstractModifiableTable
-
- org.apache.calcite.sql.ddl.SqlCreateTable.MutableArrayTable
-
- All Implemented Interfaces:
ModifiableTable
,QueryableTable
,Table
,Wrapper
- Direct Known Subclasses:
SqlCreateMaterializedView.MaterializedViewTable
- Enclosing class:
- SqlCreateTable
static class SqlCreateTable.MutableArrayTable extends SqlCreateTable.AbstractModifiableTable implements Wrapper
Table backed by a Java list.
-
-
Field Summary
Fields Modifier and Type Field Description private InitializerExpressionFactory
initializerExpressionFactory
private RelProtoDataType
protoRowType
private RelProtoDataType
protoStoredRowType
(package private) java.util.List
rows
-
Constructor Summary
Constructors Constructor Description MutableArrayTable(java.lang.String name, RelProtoDataType protoStoredRowType, RelProtoDataType protoRowType, InitializerExpressionFactory initializerExpressionFactory)
Creates a MutableArrayTable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Queryable<T>
asQueryable(QueryProvider queryProvider, SchemaPlus schema, java.lang.String tableName)
Converts this table into aQueryable
.java.lang.reflect.Type
getElementType()
Returns the element type of the collection that will implement this table.Expression
getExpression(SchemaPlus schema, java.lang.String tableName, java.lang.Class clazz)
Generates an expression with which this table can be referenced in generated code.java.util.Collection
getModifiableCollection()
Returns the modifiable collection.RelDataType
getRowType(RelDataTypeFactory typeFactory)
Returns this table's row type.<C> C
unwrap(java.lang.Class<C> aClass)
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.sql.ddl.SqlCreateTable.AbstractModifiableTable
toModificationRel
-
Methods inherited from class org.apache.calcite.schema.impl.AbstractTable
getJdbcTableType, 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, getStatistic, isRolledUp, rolledUpColumnValidInsideAgg
-
-
-
-
Field Detail
-
rows
final java.util.List rows
-
protoStoredRowType
private final RelProtoDataType protoStoredRowType
-
protoRowType
private final RelProtoDataType protoRowType
-
initializerExpressionFactory
private final InitializerExpressionFactory initializerExpressionFactory
-
-
Constructor Detail
-
MutableArrayTable
MutableArrayTable(java.lang.String name, RelProtoDataType protoStoredRowType, RelProtoDataType protoRowType, InitializerExpressionFactory initializerExpressionFactory)
Creates a MutableArrayTable.- Parameters:
name
- Name of table within its schemaprotoStoredRowType
- Prototype of row type of stored columns (all columns except virtual columns)protoRowType
- Prototype of row type (all columns)initializerExpressionFactory
- How columns are populated
-
-
Method Detail
-
getModifiableCollection
public java.util.Collection getModifiableCollection()
Description copied from interface:ModifiableTable
Returns the modifiable collection. Modifying the collection will change the table's contents.- Specified by:
getModifiableCollection
in interfaceModifiableTable
-
asQueryable
public <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema, java.lang.String tableName)
Description copied from interface:QueryableTable
Converts this table into aQueryable
.- Specified by:
asQueryable
in interfaceQueryableTable
-
getElementType
public java.lang.reflect.Type getElementType()
Description copied from interface:QueryableTable
Returns the element type of the collection that will implement this table.- Specified by:
getElementType
in interfaceQueryableTable
-
getExpression
public Expression getExpression(SchemaPlus schema, java.lang.String tableName, java.lang.Class clazz)
Description copied from interface:QueryableTable
Generates an expression with which this table can be referenced in generated code.- Specified by:
getExpression
in interfaceQueryableTable
- Parameters:
schema
- SchematableName
- Table name (unique within schema)clazz
- The desired collection class; for exampleQueryable
.
-
getRowType
public RelDataType getRowType(RelDataTypeFactory typeFactory)
Description copied from interface:Table
Returns this table's row type.This is a struct type whose fields describe the names and types of the columns in this table.
The implementer must use the type factory provided. This ensures that the type is converted into a canonical form; other equal types in the same query will use the same object.
- Specified by:
getRowType
in interfaceTable
- Parameters:
typeFactory
- Type factory with which to create the type- Returns:
- Row type
-
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 interfaceWrapper
- Overrides:
unwrap
in classAbstractTable
-
-