Class JdbcTable
java.lang.Object
org.apache.calcite.schema.impl.AbstractTable
org.apache.calcite.adapter.java.AbstractQueryableTable
org.apache.wayang.api.sql.calcite.jdbc.JdbcTable
- All Implemented Interfaces:
org.apache.calcite.schema.ModifiableTable,org.apache.calcite.schema.QueryableTable,org.apache.calcite.schema.ScannableTable,org.apache.calcite.schema.Table,org.apache.calcite.schema.TranslatableTable,org.apache.calcite.schema.Wrapper
public class JdbcTable
extends org.apache.calcite.adapter.java.AbstractQueryableTable
implements org.apache.calcite.schema.TranslatableTable, org.apache.calcite.schema.ScannableTable, org.apache.calcite.schema.ModifiableTable
Queryable that gets its data from a table within a JDBC connection.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Stringfinal JdbcSchemafinal Stringfinal Stringfinal org.apache.calcite.schema.Schema.TableTypeFields inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
elementType -
Method Summary
Modifier and TypeMethodDescription<T> org.apache.calcite.linq4j.Queryable<T>asQueryable(org.apache.calcite.linq4j.QueryProvider queryProvider, org.apache.calcite.schema.SchemaPlus schema, String tableName) org.apache.calcite.schema.Schema.TableType@Nullable Collectionorg.apache.calcite.rel.type.RelDataTypegetRowType(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) org.apache.calcite.linq4j.Enumerable<@Nullable Object[]>scan(org.apache.calcite.DataContext root) org.apache.calcite.sql.SqlIdentifierReturns the table name, qualified with catalog and schema name if applicable, as a parse tree node (SqlIdentifier).org.apache.calcite.rel.core.TableModifytoModificationRel(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelOptTable table, org.apache.calcite.prepare.Prepare.CatalogReader catalogReader, org.apache.calcite.rel.RelNode input, org.apache.calcite.rel.core.TableModify.Operation operation, @Nullable List<String> updateColumnList, @Nullable List<org.apache.calcite.rex.RexNode> sourceExpressionList, boolean flattened) org.apache.calcite.rel.RelNodetoRel(org.apache.calcite.plan.RelOptTable.ToRelContext context, org.apache.calcite.plan.RelOptTable relOptTable) toString()<C> @Nullable CMethods inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
getElementType, getExpressionMethods inherited from class org.apache.calcite.schema.impl.AbstractTable
getStatistic, isRolledUp, rolledUpColumnValidInsideAggMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.schema.QueryableTable
getElementType, getExpressionMethods inherited from interface org.apache.calcite.schema.Table
getStatistic, isRolledUp, rolledUpColumnValidInsideAggMethods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Field Details
-
jdbcSchema
-
jdbcCatalogName
-
jdbcSchemaName
-
jdbcTableName
-
jdbcTableType
public final org.apache.calcite.schema.Schema.TableType jdbcTableType
-
-
Method Details
-
toString
-
getJdbcTableType
public org.apache.calcite.schema.Schema.TableType getJdbcTableType()- Specified by:
getJdbcTableTypein interfaceorg.apache.calcite.schema.Table- Overrides:
getJdbcTableTypein classorg.apache.calcite.schema.impl.AbstractTable
-
unwrap
- Specified by:
unwrapin interfaceorg.apache.calcite.schema.Wrapper- Overrides:
unwrapin classorg.apache.calcite.schema.impl.AbstractTable
-
getRowType
public org.apache.calcite.rel.type.RelDataType getRowType(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) - Specified by:
getRowTypein interfaceorg.apache.calcite.schema.Table
-
tableName
public org.apache.calcite.sql.SqlIdentifier tableName()Returns the table name, qualified with catalog and schema name if applicable, as a parse tree node (SqlIdentifier). -
toRel
public org.apache.calcite.rel.RelNode toRel(org.apache.calcite.plan.RelOptTable.ToRelContext context, org.apache.calcite.plan.RelOptTable relOptTable) - Specified by:
toRelin interfaceorg.apache.calcite.schema.TranslatableTable
-
asQueryable
public <T> org.apache.calcite.linq4j.Queryable<T> asQueryable(org.apache.calcite.linq4j.QueryProvider queryProvider, org.apache.calcite.schema.SchemaPlus schema, String tableName) - Specified by:
asQueryablein interfaceorg.apache.calcite.schema.QueryableTable
-
scan
public org.apache.calcite.linq4j.Enumerable<@Nullable Object[]> scan(org.apache.calcite.DataContext root) - Specified by:
scanin interfaceorg.apache.calcite.schema.ScannableTable
-
getModifiableCollection
- Specified by:
getModifiableCollectionin interfaceorg.apache.calcite.schema.ModifiableTable
-
toModificationRel
public org.apache.calcite.rel.core.TableModify toModificationRel(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelOptTable table, org.apache.calcite.prepare.Prepare.CatalogReader catalogReader, org.apache.calcite.rel.RelNode input, org.apache.calcite.rel.core.TableModify.Operation operation, @Nullable List<String> updateColumnList, @Nullable List<org.apache.calcite.rex.RexNode> sourceExpressionList, boolean flattened) - Specified by:
toModificationRelin interfaceorg.apache.calcite.schema.ModifiableTable
-