public class JdbcTable extends AbstractQueryableTable implements TranslatableTable, ScannableTable, ModifiableTable
The idea is not to read the whole table, however. The idea is to use
this as a building block for a query, by applying Queryable operators
such as
ExtendedEnumerable.where(org.apache.calcite.linq4j.function.Predicate2)
.
The resulting queryable can then be converted to a SQL query, which can be
executed efficiently on the JDBC server.
Modifier and Type | Class and Description |
---|---|
private class |
JdbcTable.JdbcTableQueryable<T>
Enumerable that returns the contents of a
JdbcTable by connecting
to the JDBC data source. |
Modifier and Type | Field and Description |
---|---|
java.lang.String |
jdbcCatalogName |
JdbcSchema |
jdbcSchema |
java.lang.String |
jdbcSchemaName |
java.lang.String |
jdbcTableName |
Schema.TableType |
jdbcTableType |
private RelProtoDataType |
protoRowType |
elementType
Constructor and Description |
---|
JdbcTable(JdbcSchema jdbcSchema,
java.lang.String jdbcCatalogName,
java.lang.String jdbcSchemaName,
java.lang.String jdbcTableName,
Schema.TableType jdbcTableType) |
Modifier and Type | Method and Description |
---|---|
<T> Queryable<T> |
asQueryable(QueryProvider queryProvider,
SchemaPlus schema,
java.lang.String tableName)
Converts this table into a
Queryable . |
private java.util.List<Pair<org.apache.calcite.avatica.ColumnMetaData.Rep,java.lang.Integer>> |
fieldClasses(JavaTypeFactory typeFactory) |
(package private) SqlString |
generateSql() |
Schema.TableType |
getJdbcTableType()
Type of table.
|
java.util.Collection |
getModifiableCollection()
Returns the modifiable collection.
|
RelDataType |
getRowType(RelDataTypeFactory typeFactory)
Returns this table's row type.
|
Enumerable<java.lang.Object[]> |
scan(DataContext root)
Returns an enumerator over the rows in this Table.
|
SqlIdentifier |
tableName()
Returns the table name, qualified with catalog and schema name if
applicable, as a parse tree node (
SqlIdentifier ). |
TableModify |
toModificationRel(RelOptCluster cluster,
RelOptTable table,
Prepare.CatalogReader catalogReader,
RelNode input,
TableModify.Operation operation,
java.util.List<java.lang.String> updateColumnList,
java.util.List<RexNode> sourceExpressionList,
boolean flattened)
Creates a relational expression that modifies this table.
|
RelNode |
toRel(RelOptTable.ToRelContext context,
RelOptTable relOptTable)
Converts this table into a
relational expression . |
java.lang.String |
toString() |
getElementType, getExpression
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getElementType, getExpression
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg
private RelProtoDataType protoRowType
public final JdbcSchema jdbcSchema
public final java.lang.String jdbcCatalogName
public final java.lang.String jdbcSchemaName
public final java.lang.String jdbcTableName
public final Schema.TableType jdbcTableType
JdbcTable(JdbcSchema jdbcSchema, java.lang.String jdbcCatalogName, java.lang.String jdbcSchemaName, java.lang.String jdbcTableName, Schema.TableType jdbcTableType)
public java.lang.String toString()
toString
in class java.lang.Object
public Schema.TableType getJdbcTableType()
Table
getJdbcTableType
in interface Table
getJdbcTableType
in class AbstractTable
public RelDataType getRowType(RelDataTypeFactory typeFactory)
Table
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.
getRowType
in interface Table
typeFactory
- Type factory with which to create the typeprivate java.util.List<Pair<org.apache.calcite.avatica.ColumnMetaData.Rep,java.lang.Integer>> fieldClasses(JavaTypeFactory typeFactory)
SqlString generateSql()
public SqlIdentifier tableName()
SqlIdentifier
).public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable)
TranslatableTable
relational expression
.toRel
in interface TranslatableTable
public <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema, java.lang.String tableName)
QueryableTable
Queryable
.asQueryable
in interface QueryableTable
public Enumerable<java.lang.Object[]> scan(DataContext root)
ScannableTable
scan
in interface ScannableTable
public java.util.Collection getModifiableCollection()
ModifiableTable
getModifiableCollection
in interface ModifiableTable
public TableModify toModificationRel(RelOptCluster cluster, RelOptTable table, Prepare.CatalogReader catalogReader, RelNode input, TableModify.Operation operation, java.util.List<java.lang.String> updateColumnList, java.util.List<RexNode> sourceExpressionList, boolean flattened)
ModifiableTable
toModificationRel
in interface ModifiableTable
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.