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

    Fields
    Modifier and Type
    Field
    Description
    final String
     
     
    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 Type
    Method
    Description
    <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)
     
     
    <C> @Nullable C
    unwrap(Class<C> aClass)
     

    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

      public final JdbcSchema jdbcSchema
    • jdbcCatalogName

      public final String jdbcCatalogName
    • jdbcSchemaName

      public final String jdbcSchemaName
    • jdbcTableName

      public final String jdbcTableName
    • jdbcTableType

      public final org.apache.calcite.schema.Schema.TableType jdbcTableType
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getJdbcTableType

      public org.apache.calcite.schema.Schema.TableType getJdbcTableType()
      Specified by:
      getJdbcTableType in interface org.apache.calcite.schema.Table
      Overrides:
      getJdbcTableType in class org.apache.calcite.schema.impl.AbstractTable
    • unwrap

      public <C> @Nullable C unwrap(Class<C> aClass)
      Specified by:
      unwrap in interface org.apache.calcite.schema.Wrapper
      Overrides:
      unwrap in class org.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 interface org.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 interface org.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 interface org.apache.calcite.schema.QueryableTable
    • scan

      public org.apache.calcite.linq4j.Enumerable<@Nullable Object[]> scan(org.apache.calcite.DataContext root)
      Specified by:
      scan in interface org.apache.calcite.schema.ScannableTable
    • getModifiableCollection

      public @Nullable Collection getModifiableCollection()
      Specified by:
      getModifiableCollection in interface org.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 interface org.apache.calcite.schema.ModifiableTable