Class CalciteTable

java.lang.Object
org.apache.calcite.schema.impl.AbstractTable
org.apache.nifi.sql.internal.CalciteTable
All Implemented Interfaces:
org.apache.calcite.schema.QueryableTable, org.apache.calcite.schema.Table, org.apache.calcite.schema.TranslatableTable, org.apache.calcite.schema.Wrapper

public class CalciteTable extends org.apache.calcite.schema.impl.AbstractTable implements org.apache.calcite.schema.QueryableTable, org.apache.calcite.schema.TranslatableTable

An internal representation of a NiFiTable that is necessary for Apache Calcite. This class never be referenced outside of the module in which it is defined.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Function<int[],org.apache.calcite.linq4j.Enumerable<Object>>
     
    private final Function<org.apache.calcite.rel.type.RelDataTypeFactory,org.apache.calcite.rel.type.RelDataType>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CalciteTable(Function<org.apache.calcite.rel.type.RelDataTypeFactory,org.apache.calcite.rel.type.RelDataType> tableDefinitionFactory, Function<int[],org.apache.calcite.linq4j.Enumerable<Object>> projectionFactory)
     
  • 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.linq4j.tree.Expression
    getExpression(org.apache.calcite.schema.SchemaPlus schema, String tableName, Class clazz)
     
    org.apache.calcite.rel.type.RelDataType
    getRowType(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory)
     
    org.apache.calcite.linq4j.Enumerable<Object>
    project(org.apache.calcite.DataContext dataContext, int[] fields)
     
    org.apache.calcite.rel.RelNode
    toRel(org.apache.calcite.plan.RelOptTable.ToRelContext context, org.apache.calcite.plan.RelOptTable relOptTable)
     

    Methods inherited from class org.apache.calcite.schema.impl.AbstractTable

    getJdbcTableType, getStatistic, isRolledUp, rolledUpColumnValidInsideAgg, unwrap

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.calcite.schema.Table

    getJdbcTableType, getStatistic, isRolledUp, rolledUpColumnValidInsideAgg

    Methods inherited from interface org.apache.calcite.schema.Wrapper

    maybeUnwrap, unwrapOrThrow
  • Field Details

    • tableDefinitionFactory

      private final Function<org.apache.calcite.rel.type.RelDataTypeFactory,org.apache.calcite.rel.type.RelDataType> tableDefinitionFactory
    • projectionFactory

      private final Function<int[],org.apache.calcite.linq4j.Enumerable<Object>> projectionFactory
  • Constructor Details

    • CalciteTable

      public CalciteTable(Function<org.apache.calcite.rel.type.RelDataTypeFactory,org.apache.calcite.rel.type.RelDataType> tableDefinitionFactory, Function<int[],org.apache.calcite.linq4j.Enumerable<Object>> projectionFactory)
  • Method Details

    • project

      public org.apache.calcite.linq4j.Enumerable<Object> project(org.apache.calcite.DataContext dataContext, int[] fields)
    • getExpression

      public org.apache.calcite.linq4j.tree.Expression getExpression(org.apache.calcite.schema.SchemaPlus schema, String tableName, Class clazz)
      Specified by:
      getExpression in interface org.apache.calcite.schema.QueryableTable
    • getElementType

      public Type getElementType()
      Specified by:
      getElementType in interface org.apache.calcite.schema.QueryableTable
    • 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
    • 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
    • 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