Package org.apache.calcite.schema.impl
Class ListTransientTable
java.lang.Object
org.apache.calcite.schema.impl.AbstractTable
org.apache.calcite.adapter.java.AbstractQueryableTable
org.apache.calcite.schema.impl.ListTransientTable
- All Implemented Interfaces:
ModifiableTable
,QueryableTable
,ScannableTable
,Table
,TransientTable
,Wrapper
public class ListTransientTable
extends AbstractQueryableTable
implements TransientTable, ModifiableTable, ScannableTable
TransientTable
backed by a Java list. It will be automatically added to the
current schema when scan(DataContext)
method gets called.
NOTE: The current API is experimental and subject to change without notice.
-
Field Summary
Fields inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
elementType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> Queryable<T>
asQueryable
(QueryProvider queryProvider, SchemaPlus schema, String tableName) Converts this table into aQueryable
.Returns the element type of the collection that will implement this table.getExpression
(SchemaPlus schema, String tableName, Class clazz) Generates an expression with which this table can be referenced in generated code.Returns the modifiable collection.getRowType
(RelDataTypeFactory typeFactory) Returns this table's row type.Enumerable<@Nullable Object[]>
scan
(DataContext root) Returns an enumerator over the rows in this Table.toModificationRel
(RelOptCluster cluster, RelOptTable table, Prepare.CatalogReader catalogReader, RelNode child, TableModify.Operation operation, @Nullable List<String> updateColumnList, @Nullable List<RexNode> sourceExpressionList, boolean flattened) Creates a relational expression that modifies this table.Methods inherited from class org.apache.calcite.schema.impl.AbstractTable
getJdbcTableType, getStatistic, isRolledUp, rolledUpColumnValidInsideAgg, unwrap
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
Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Constructor Details
-
ListTransientTable
-
-
Method Details
-
toModificationRel
public TableModify toModificationRel(RelOptCluster cluster, RelOptTable table, Prepare.CatalogReader catalogReader, RelNode child, TableModify.Operation operation, @Nullable List<String> updateColumnList, @Nullable List<RexNode> sourceExpressionList, boolean flattened) Description copied from interface:ModifiableTable
Creates a relational expression that modifies this table.- Specified by:
toModificationRel
in interfaceModifiableTable
-
getModifiableCollection
Description copied from interface:ModifiableTable
Returns the modifiable collection. Modifying the collection will change the table's contents.- Specified by:
getModifiableCollection
in interfaceModifiableTable
-
scan
Description copied from interface:ScannableTable
Returns an enumerator over the rows in this Table. Each row is represented as an array of its column values.- Specified by:
scan
in interfaceScannableTable
-
getExpression
Description copied from interface:QueryableTable
Generates an expression with which this table can be referenced in generated code.- Specified by:
getExpression
in interfaceQueryableTable
- Overrides:
getExpression
in classAbstractQueryableTable
- Parameters:
schema
- SchematableName
- Table name (unique within schema)clazz
- The desired collection class; for exampleQueryable
.
-
asQueryable
public <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) Description copied from interface:QueryableTable
Converts this table into aQueryable
.- Specified by:
asQueryable
in interfaceQueryableTable
-
getRowType
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
-
getElementType
Description copied from interface:QueryableTable
Returns the element type of the collection that will implement this table.- Specified by:
getElementType
in interfaceQueryableTable
- Overrides:
getElementType
in classAbstractQueryableTable
-