Class QueryHandler

All Implemented Interfaces:
SqlStatementHandler
Direct Known Subclasses:
IngestHandler, QueryHandler.SelectHandler

public abstract class QueryHandler extends SqlStatementHandler.BaseStatementHandler
Abstract base class for handlers that revolve around queries: SELECT, INSERT and REPLACE. This class handles the common SELECT portion of the statement.
  • Field Details

    • explain

      protected org.apache.calcite.sql.SqlExplain explain
    • rootQueryRel

      protected org.apache.calcite.rel.RelRoot rootQueryRel
    • rexBuilder

      protected org.apache.calcite.rex.RexBuilder rexBuilder
  • Constructor Details

  • Method Details

    • validate

      protected org.apache.calcite.sql.SqlNode validate(org.apache.calcite.sql.SqlNode root)
    • prepare

      public void prepare()
    • prepareResult

      public PrepareResult prepareResult()
    • validatedQueryNode

      protected abstract org.apache.calcite.sql.SqlNode validatedQueryNode()
    • returnedRowType

      protected abstract org.apache.calcite.rel.type.RelDataType returnedRowType()
    • plan

      public PlannerResult plan()
    • explainAttributes

      public ExplainAttributes explainAttributes()
    • planExplanation

      protected PlannerResult planExplanation(org.apache.calcite.rel.RelRoot relRoot, org.apache.calcite.rel.RelNode rel, boolean isDruidConventionExplanation)
      Construct a PlannerResult for an 'explain' query from a RelNode and root RelRoot
    • planForDruid

      protected abstract PlannerResult planForDruid() throws org.apache.calcite.tools.ValidationException
      Throws:
      org.apache.calcite.tools.ValidationException
    • planWithDruidConvention

      protected PlannerResult planWithDruidConvention() throws org.apache.calcite.tools.ValidationException
      Construct a PlannerResult for a RelNode that is directly translatable to a native Druid query.
      Throws:
      org.apache.calcite.tools.ValidationException
    • buildQueryMaker

      protected abstract QueryMaker buildQueryMaker(org.apache.calcite.rel.RelRoot rootQueryRel) throws org.apache.calcite.tools.ValidationException
      Throws:
      org.apache.calcite.tools.ValidationException