Class ExternalTable

java.lang.Object
org.apache.druid.sql.calcite.table.DruidTable
org.apache.druid.sql.calcite.table.ExternalTable
All Implemented Interfaces:
org.apache.calcite.schema.Table, org.apache.calcite.schema.TranslatableTable

public class ExternalTable extends DruidTable
Represents an source of data external to Druid: a CSV file, an HTTP request, etc. Each such table represents one of Druid's DataSource types. Since SQL requires knowledge of the schema of that input source, the user must provide that information in SQL (via the `EXTERN` or up-coming `STAGED` function) or from the Druid Catalog.
  • Constructor Details

    • ExternalTable

      public ExternalTable(DataSource dataSource, RowSignature rowSignature, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.google.common.base.Supplier<Set<String>> inputSourceTypesSupplier)
  • Method Details

    • getDataSource

      public DataSource getDataSource()
      Specified by:
      getDataSource in class DruidTable
    • isJoinable

      public boolean isJoinable()
      Specified by:
      isJoinable in class DruidTable
    • isBroadcast

      public boolean isBroadcast()
      Specified by:
      isBroadcast in class DruidTable
    • 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
      Overrides:
      getRowType in class DruidTable
    • getInputSourceTypeSupplier

      public com.google.common.base.Supplier<Set<String>> getInputSourceTypeSupplier()
    • toRel

      public org.apache.calcite.rel.RelNode toRel(org.apache.calcite.plan.RelOptTable.ToRelContext context, org.apache.calcite.plan.RelOptTable relOptTable)
    • toString

      public String toString()
      Overrides:
      toString in class DruidTable