Class DruidRel<T extends DruidRel<?>>

java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.druid.sql.calcite.rel.DruidRel<T>
All Implemented Interfaces:
Cloneable, org.apache.calcite.plan.RelOptNode, org.apache.calcite.rel.RelNode
Direct Known Subclasses:
DruidCorrelateUnnestRel, DruidJoinQueryRel, DruidOuterQueryRel, DruidQueryRel, DruidUnionDataSourceRel, DruidUnionRel, DruidUnnestRel

public abstract class DruidRel<T extends DruidRel<?>> extends org.apache.calcite.rel.AbstractRelNode
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode

    org.apache.calcite.rel.RelNode.Context
  • Field Summary

    Fields inherited from class org.apache.calcite.rel.AbstractRelNode

    digest, id, rowType, traitSet
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    DruidRel(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traitSet, PlannerContext plannerContext)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract T
    Returns a copy of this rel with the DruidConvention trait.
    protected Object
     
    org.apache.calcite.rel.RelWriter
    explainTerms(org.apache.calcite.rel.RelWriter pw)
    Overridden to ensure that subclasses provide a proper implementation.
    abstract Set<String>
    Get the set of names of table datasources read by this DruidRel
    Returns the PartialDruidQuery associated with this DruidRel, and which can be built on top of.
     
    boolean
     
     
    abstract DruidQuery
    toDruidQuery(boolean finalizeAggregations)
    Convert this DruidRel to a DruidQuery.
    abstract DruidQuery
    Convert this DruidRel to a DruidQuery for purposes of explaining.
    final org.apache.calcite.rel.RelNode
     
    abstract T
     

    Methods inherited from class org.apache.calcite.rel.AbstractRelNode

    accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, copy, deepEquals, deepHashCode, deriveRowType, equals, estimateRowCount, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getInputs, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, isValid, metadata, onRegister, recomputeDigest, register, replaceInput, sole, toString

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.calcite.rel.RelNode

    explain, fieldIsNullable, stripped
  • Constructor Details

    • DruidRel

      protected DruidRel(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traitSet, PlannerContext plannerContext)
  • Method Details

    • getPartialDruidQuery

      @Nullable public abstract PartialDruidQuery getPartialDruidQuery()
      Returns the PartialDruidQuery associated with this DruidRel, and which can be built on top of. Returns null if this rel cannot be built on top of.
    • runQuery

      public QueryResponse<Object[]> runQuery()
    • withPartialQuery

      public abstract T withPartialQuery(PartialDruidQuery newQueryBuilder)
    • isValidDruidQuery

      public boolean isValidDruidQuery()
    • toDruidQuery

      public abstract DruidQuery toDruidQuery(boolean finalizeAggregations)
      Convert this DruidRel to a DruidQuery. This must be an inexpensive operation, since it is done often throughout query planning. This method must not return null.
      Parameters:
      finalizeAggregations - true if this query should include explicit finalization for all of its aggregators, where required. Useful for subqueries where Druid's native query layer does not do this automatically.
      Throws:
      CannotBuildQueryException
    • toDruidQueryForExplaining

      public abstract DruidQuery toDruidQueryForExplaining()
      Convert this DruidRel to a DruidQuery for purposes of explaining. This must be an inexpensive operation. This method must not return null.
      Throws:
      CannotBuildQueryException
    • getPlannerContext

      public PlannerContext getPlannerContext()
    • explainTerms

      public org.apache.calcite.rel.RelWriter explainTerms(org.apache.calcite.rel.RelWriter pw)
      Overridden to ensure that subclasses provide a proper implementation. The default implementation from AbstractRelNode does nothing and is not appropriate.
      Overrides:
      explainTerms in class org.apache.calcite.rel.AbstractRelNode
    • clone

      protected Object clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • asDruidConvention

      public abstract T asDruidConvention()
      Returns a copy of this rel with the DruidConvention trait.
    • getDataSourceNames

      public abstract Set<String> getDataSourceNames()
      Get the set of names of table datasources read by this DruidRel
    • unwrapLogicalPlan

      public final org.apache.calcite.rel.RelNode unwrapLogicalPlan()