Class QueryHandler
java.lang.Object
org.apache.druid.sql.calcite.planner.SqlStatementHandler.BaseStatementHandler
org.apache.druid.sql.calcite.planner.QueryHandler
- All Implemented Interfaces:
SqlStatementHandler
- Direct Known Subclasses:
IngestHandler,QueryHandler.SelectHandler
Abstract base class for handlers that revolve around queries: SELECT,
INSERT and REPLACE. This class handles the common SELECT portion of the statement.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.druid.sql.calcite.planner.SqlStatementHandler
SqlStatementHandler.BaseStatementHandler, SqlStatementHandler.HandlerContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.calcite.sql.SqlExplainprotected org.apache.calcite.rex.RexBuilderprotected org.apache.calcite.rel.RelRootFields inherited from class org.apache.druid.sql.calcite.planner.SqlStatementHandler.BaseStatementHandler
handlerContext, resourceActions -
Constructor Summary
ConstructorsConstructorDescriptionQueryHandler(SqlStatementHandler.HandlerContext handlerContext, org.apache.calcite.sql.SqlExplain explain) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract QueryMakerbuildQueryMaker(org.apache.calcite.rel.RelRoot rootQueryRel) plan()protected PlannerResultplanExplanation(org.apache.calcite.rel.RelRoot relRoot, org.apache.calcite.rel.RelNode rel, boolean isDruidConventionExplanation) protected abstract PlannerResultprotected PlannerResultConstruct aPlannerResultfor aRelNodethat is directly translatable to a native Druid query.voidprepare()protected abstract org.apache.calcite.rel.type.RelDataTypeprotected org.apache.calcite.sql.SqlNodevalidate(org.apache.calcite.sql.SqlNode root) protected abstract org.apache.calcite.sql.SqlNodeMethods inherited from class org.apache.druid.sql.calcite.planner.SqlStatementHandler.BaseStatementHandler
resourceActionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.sql.calcite.planner.SqlStatementHandler
validate
-
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
-
QueryHandler
public QueryHandler(SqlStatementHandler.HandlerContext handlerContext, org.apache.calcite.sql.SqlExplain explain)
-
-
Method Details
-
validate
protected org.apache.calcite.sql.SqlNode validate(org.apache.calcite.sql.SqlNode root) -
prepare
public void prepare() -
prepareResult
-
validatedQueryNode
protected abstract org.apache.calcite.sql.SqlNode validatedQueryNode() -
returnedRowType
protected abstract org.apache.calcite.rel.type.RelDataType returnedRowType() -
plan
-
explainAttributes
-
planExplanation
protected PlannerResult planExplanation(org.apache.calcite.rel.RelRoot relRoot, org.apache.calcite.rel.RelNode rel, boolean isDruidConventionExplanation) -
planForDruid
- Throws:
org.apache.calcite.tools.ValidationException
-
planWithDruidConvention
protected PlannerResult planWithDruidConvention() throws org.apache.calcite.tools.ValidationExceptionConstruct aPlannerResultfor aRelNodethat 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
-