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 String
final JdbcSchema
final String
final String
final org.apache.calcite.schema.Schema.TableType
Fields 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 Collection
org.apache.calcite.rel.type.RelDataType
getRowType
(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) org.apache.calcite.linq4j.Enumerable<@Nullable Object[]>
scan
(org.apache.calcite.DataContext root) org.apache.calcite.sql.SqlIdentifier
Returns the table name, qualified with catalog and schema name if applicable, as a parse tree node (SqlIdentifier
).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) org.apache.calcite.rel.RelNode
toRel
(org.apache.calcite.plan.RelOptTable.ToRelContext context, org.apache.calcite.plan.RelOptTable relOptTable) toString()
<C> @Nullable C
Methods inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
getElementType, getExpression
Methods inherited from class org.apache.calcite.schema.impl.AbstractTable
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.calcite.schema.QueryableTable
getElementType, getExpression
Methods inherited from interface org.apache.calcite.schema.Table
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg
Methods 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:
getJdbcTableType
in interfaceorg.apache.calcite.schema.Table
- Overrides:
getJdbcTableType
in classorg.apache.calcite.schema.impl.AbstractTable
-
unwrap
- Specified by:
unwrap
in interfaceorg.apache.calcite.schema.Wrapper
- Overrides:
unwrap
in classorg.apache.calcite.schema.impl.AbstractTable
-
getRowType
public org.apache.calcite.rel.type.RelDataType getRowType(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) - Specified by:
getRowType
in 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:
toRel
in 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:
asQueryable
in interfaceorg.apache.calcite.schema.QueryableTable
-
scan
public org.apache.calcite.linq4j.Enumerable<@Nullable Object[]> scan(org.apache.calcite.DataContext root) - Specified by:
scan
in interfaceorg.apache.calcite.schema.ScannableTable
-
getModifiableCollection
- Specified by:
getModifiableCollection
in 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:
toModificationRel
in interfaceorg.apache.calcite.schema.ModifiableTable
-