Class PartialDruidQuery

java.lang.Object
org.apache.druid.sql.calcite.rel.PartialDruidQuery

public class PartialDruidQuery extends Object
Builder for a Druid query, not counting the "dataSource" (which will be slotted in later).
  • Method Details

    • create

      public static PartialDruidQuery create(org.apache.calcite.rel.RelNode inputRel)
    • createOuterQuery

      public static PartialDruidQuery createOuterQuery(PartialDruidQuery inputQuery, PlannerContext plannerContext)
    • getScan

      public org.apache.calcite.rel.RelNode getScan()
    • getWhereFilter

      public org.apache.calcite.rel.core.Filter getWhereFilter()
    • getSelectProject

      public org.apache.calcite.rel.core.Project getSelectProject()
    • getAggregate

      public org.apache.calcite.rel.core.Aggregate getAggregate()
    • getHavingFilter

      public org.apache.calcite.rel.core.Filter getHavingFilter()
    • getAggregateProject

      public org.apache.calcite.rel.core.Project getAggregateProject()
    • getSort

      public org.apache.calcite.rel.core.Sort getSort()
    • getSortProject

      public org.apache.calcite.rel.core.Project getSortProject()
    • getWindow

      public org.apache.calcite.rel.core.Window getWindow()
    • getWindowProject

      public org.apache.calcite.rel.core.Project getWindowProject()
    • withWhereFilter

      public PartialDruidQuery withWhereFilter(org.apache.calcite.rel.core.Filter newWhereFilter)
    • withSelectProject

      public PartialDruidQuery withSelectProject(org.apache.calcite.rel.core.Project newSelectProject)
    • mergeProject

      public PartialDruidQuery mergeProject(org.apache.calcite.rel.core.Project newSelectProject)
    • withAggregate

      public PartialDruidQuery withAggregate(org.apache.calcite.rel.core.Aggregate newAggregate)
    • withHavingFilter

      public PartialDruidQuery withHavingFilter(org.apache.calcite.rel.core.Filter newHavingFilter)
    • withAggregateProject

      public PartialDruidQuery withAggregateProject(org.apache.calcite.rel.core.Project newAggregateProject)
    • withSort

      public PartialDruidQuery withSort(org.apache.calcite.rel.core.Sort newSort)
    • withSortProject

      public PartialDruidQuery withSortProject(org.apache.calcite.rel.core.Project newSortProject)
    • withWindow

      public PartialDruidQuery withWindow(org.apache.calcite.rel.core.Window newWindow)
    • withWindowProject

      public PartialDruidQuery withWindowProject(org.apache.calcite.rel.core.Project newWindowProject)
    • getRowType

      public org.apache.calcite.rel.type.RelDataType getRowType()
    • getTraitSet

      public org.apache.calcite.plan.RelTraitSet getTraitSet(org.apache.calcite.plan.Convention convention, PlannerContext plannerContext)
      Get traits for this partial query. This is the traits from leafRel(), plus RelCollationTraitDef if stage() is PartialDruidQuery.Stage.AGGREGATE or PartialDruidQuery.Stage.AGGREGATE_PROJECT (to represent the fact that Druid sorts by grouping keys when grouping).
      Parameters:
      convention - convention to include in the returned array
    • build

      public DruidQuery build(DataSource dataSource, RowSignature sourceRowSignature, PlannerContext plannerContext, org.apache.calcite.rex.RexBuilder rexBuilder, boolean finalizeAggregations, boolean applyPolicies)
    • build

      public DruidQuery build(DataSource dataSource, RowSignature sourceRowSignature, PlannerContext plannerContext, org.apache.calcite.rex.RexBuilder rexBuilder, boolean finalizeAggregations, boolean applyPolicies, @Nullable VirtualColumnRegistry virtualColumnRegistry)
    • canAccept

      public boolean canAccept(PartialDruidQuery.Stage stage)
    • stage

      public PartialDruidQuery.Stage stage()
      Returns the stage corresponding to the rel at the end of the query. It will match the rel returned from leafRel().
      Returns:
      stage
    • leafRel

      public org.apache.calcite.rel.RelNode leafRel()
      Returns the rel at the end of the query. It will match the stage returned from stage().
      Returns:
      leaf rel
    • estimateCost

      public double estimateCost()
      Estimates the per-row cost of running this query.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object