Class AbstractTableSchema

java.lang.Object
org.apache.druid.sql.calcite.schema.AbstractTableSchema
All Implemented Interfaces:
org.apache.calcite.schema.Schema
Direct Known Subclasses:
DruidSchema

public abstract class AbstractTableSchema extends Object implements org.apache.calcite.schema.Schema
Calcite provides two "schema" abstractions. Schema is an interface, while AbstractSchema is a base class that "locks down" the Schema.getTable(java.lang.String) method to obtain the table from a map. This forces the extensions of that class to materialize all tables in the schema, so that Calcite can pick the one it wants. This class, by contrast, provides the same defaults as AbstractSchema, but assumes its subslasses will implement getTable() to directly look up that one table, ignoring all others. Doing so lowers the cost of table resolution, especially when the system has to fetch catalog information for the table: we only fetch the information we need, not information for all tables.
  • Field Details

    • EMPTY_NAMES

      protected static final Set<String> EMPTY_NAMES
  • Constructor Details

    • AbstractTableSchema

      public AbstractTableSchema()
  • Method Details

    • getType

      public org.apache.calcite.rel.type.RelProtoDataType getType(String name)
      Specified by:
      getType in interface org.apache.calcite.schema.Schema
    • getTypeNames

      public Set<String> getTypeNames()
      Specified by:
      getTypeNames in interface org.apache.calcite.schema.Schema
    • getFunctions

      public Collection<org.apache.calcite.schema.Function> getFunctions(String name)
      Specified by:
      getFunctions in interface org.apache.calcite.schema.Schema
    • getFunctionNames

      public Set<String> getFunctionNames()
      Specified by:
      getFunctionNames in interface org.apache.calcite.schema.Schema
    • getSubSchema

      public org.apache.calcite.schema.Schema getSubSchema(String name)
      Specified by:
      getSubSchema in interface org.apache.calcite.schema.Schema
    • getSubSchemaNames

      public Set<String> getSubSchemaNames()
      Specified by:
      getSubSchemaNames in interface org.apache.calcite.schema.Schema
    • getExpression

      public org.apache.calcite.linq4j.tree.Expression getExpression(org.apache.calcite.schema.SchemaPlus parentSchema, String name)
      Specified by:
      getExpression in interface org.apache.calcite.schema.Schema
    • isMutable

      public boolean isMutable()
      Specified by:
      isMutable in interface org.apache.calcite.schema.Schema
    • snapshot

      public org.apache.calcite.schema.Schema snapshot(org.apache.calcite.schema.SchemaVersion version)
      Specified by:
      snapshot in interface org.apache.calcite.schema.Schema