Class DrillTable

java.lang.Object
org.apache.drill.exec.planner.logical.DrillTable
All Implemented Interfaces:
org.apache.calcite.schema.Table, org.apache.calcite.schema.TranslatableTable
Direct Known Subclasses:
AbstractHBaseDrillTable, CassandraDynamicTable, DrillHiveTable, DynamicDrillTable, InfoSchemaDrillTable, StaticDrillTable

public abstract class DrillTable extends Object implements org.apache.calcite.schema.Table, org.apache.calcite.schema.TranslatableTable
  • Constructor Details

    • DrillTable

      public DrillTable(String storageEngineName, StoragePlugin plugin, String userName, DrillTableSelection selection)
      Creates a DrillTable instance for a @{code TableType#Table} table.
      Parameters:
      storageEngineName - StorageEngine name.
      plugin - Reference to StoragePlugin.
      userName - Whom to impersonate while reading the contents of the table.
      selection - Table contents (type and contents depend on type of StoragePlugin).
    • DrillTable

      public DrillTable(String storageEngineName, StoragePlugin plugin, org.apache.calcite.schema.Schema.TableType tableType, String userName, DrillTableSelection selection)
      Creates a DrillTable instance.
      Parameters:
      storageEngineName - StorageEngine name.
      plugin - Reference to StoragePlugin.
      tableType - the JDBC table type
      userName - Whom to impersonate while reading the contents of the table.
      selection - Table contents (type and contents depend on type of StoragePlugin).
    • DrillTable

      public DrillTable(String storageEngineName, StoragePlugin plugin, org.apache.calcite.schema.Schema.TableType tableType, String userName, DrillTableSelection selection, MetadataProviderManager metadataProviderManager)
    • DrillTable

      public DrillTable(String storageEngineName, StoragePlugin plugin, DrillTableSelection selection)
      TODO: Same purpose as other constructor except the impersonation user is the user who is running the Drillbit process. Once we add impersonation to non-FileSystem storage plugins such as Hive, HBase etc, we can remove this constructor.
  • Method Details

    • setOptions

      public void setOptions(SessionOptionManager options)
    • setGroupScan

      public void setGroupScan(GroupScan scan)
    • setTableMetadataProviderManager

      public void setTableMetadataProviderManager(MetadataProviderManager metadataProviderManager)
    • getGroupScan

      public GroupScan getGroupScan() throws IOException
      Throws:
      IOException
    • getMetadataProviderManager

      public MetadataProviderManager getMetadataProviderManager()
      Returns manager for TableMetadataProvider which may provide null for the case when scan wasn't created. This method should be used only for the case when it is possible to obtain TableMetadataProvider when supplier returns null or TableMetadataProvider usage may be omitted.
      Returns:
      supplier for TableMetadataProvider
    • getStorageEngineConfig

      public StoragePluginConfig getStorageEngineConfig()
    • getPlugin

      public StoragePlugin getPlugin()
    • getSelection

      public Object getSelection()
    • getStorageEngineName

      public String getStorageEngineName()
    • getUserName

      public String getUserName()
    • getStatistic

      public org.apache.calcite.schema.Statistic getStatistic()
      Specified by:
      getStatistic in interface org.apache.calcite.schema.Table
    • toRel

      public org.apache.calcite.rel.RelNode toRel(org.apache.calcite.plan.RelOptTable.ToRelContext context, org.apache.calcite.plan.RelOptTable table)
      Specified by:
      toRel in interface org.apache.calcite.schema.TranslatableTable
    • getJdbcTableType

      public org.apache.calcite.schema.Schema.TableType getJdbcTableType()
      Specified by:
      getJdbcTableType in interface org.apache.calcite.schema.Table
    • rolledUpColumnValidInsideAgg

      public boolean rolledUpColumnValidInsideAgg(String column, org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.SqlNode parent, org.apache.calcite.config.CalciteConnectionConfig config)
      Specified by:
      rolledUpColumnValidInsideAgg in interface org.apache.calcite.schema.Table
    • isRolledUp

      public boolean isRolledUp(String column)
      Specified by:
      isRolledUp in interface org.apache.calcite.schema.Table
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object