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 |
|---|---|
private String |
jdbcCatalogName |
private JdbcSchema |
jdbcSchema |
private String |
jdbcSchemaName |
private String |
jdbcTableName |
private Schema.TableType |
jdbcTableType |
private RelProtoDataType |
protoRowType |
elementType| Constructor and Description |
|---|
JdbcTable(JdbcSchema jdbcSchema,
String jdbcCatalogName,
String jdbcSchemaName,
String tableName,
Schema.TableType jdbcTableType) |
| Modifier and Type | Method and Description |
|---|---|
<T> Queryable<T> |
asQueryable(QueryProvider queryProvider,
SchemaPlus schema,
String tableName)
Converts this table into a
Queryable. |
private List<Pair<org.apache.calcite.avatica.ColumnMetaData.Rep,Integer>> |
fieldClasses(JavaTypeFactory typeFactory) |
(package private) SqlString |
generateSql() |
Schema.TableType |
getJdbcTableType()
Type of table.
|
Collection |
getModifiableCollection()
Returns the modifiable collection.
|
RelDataType |
getRowType(RelDataTypeFactory typeFactory)
Returns this table's row type.
|
Enumerable<Object[]> |
scan(DataContext root)
Returns an enumerator over the rows in this Table.
|
(package private) SqlIdentifier |
tableName() |
TableModify |
toModificationRel(RelOptCluster cluster,
RelOptTable table,
Prepare.CatalogReader catalogReader,
RelNode input,
TableModify.Operation operation,
List<String> updateColumnList,
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. |
String |
toString() |
getElementType, getExpressiongetStatistic, isRolledUp, rolledUpColumnValidInsideAgg, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetElementType, getExpressiongetStatistic, isRolledUp, rolledUpColumnValidInsideAggprivate RelProtoDataType protoRowType
private final JdbcSchema jdbcSchema
private final String jdbcCatalogName
private final String jdbcSchemaName
private final String jdbcTableName
private final Schema.TableType jdbcTableType
JdbcTable(JdbcSchema jdbcSchema, String jdbcCatalogName, String jdbcSchemaName, String tableName, Schema.TableType jdbcTableType)
public Schema.TableType getJdbcTableType()
TablegetJdbcTableType in interface TablegetJdbcTableType in class AbstractTablepublic RelDataType getRowType(RelDataTypeFactory typeFactory)
TableThis 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 TabletypeFactory - Type factory with which to create the typeprivate List<Pair<org.apache.calcite.avatica.ColumnMetaData.Rep,Integer>> fieldClasses(JavaTypeFactory typeFactory)
SqlString generateSql()
SqlIdentifier tableName()
public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable)
TranslatableTablerelational expression.toRel in interface TranslatableTablepublic <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName)
QueryableTableQueryable.asQueryable in interface QueryableTablepublic Enumerable<Object[]> scan(DataContext root)
ScannableTablescan in interface ScannableTablepublic Collection getModifiableCollection()
ModifiableTablegetModifiableCollection in interface ModifiableTablepublic TableModify toModificationRel(RelOptCluster cluster, RelOptTable table, Prepare.CatalogReader catalogReader, RelNode input, TableModify.Operation operation, List<String> updateColumnList, List<RexNode> sourceExpressionList, boolean flattened)
ModifiableTabletoModificationRel in interface ModifiableTableCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.