Class ViewSqlEngine
java.lang.Object
org.apache.druid.sql.calcite.view.ViewSqlEngine
- All Implemented Interfaces:
SqlEngine
Engine used for getting the row type of views. Does not do any actual planning or execution of the view.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuildQueryMakerForInsert(IngestDestination destination, org.apache.calcite.rel.RelRoot relRoot, PlannerContext plannerContext) Create aQueryMakerfor an INSERT ...buildQueryMakerForSelect(org.apache.calcite.rel.RelRoot relRoot, PlannerContext plannerContext) Create aQueryMakerfor a SELECT query.booleanfeatureAvailable(EngineFeature feature) Whether a feature applies to this engine or not.Returns aSqlStatementFactorywhich uses this engine to create statements.name()Name of this engine.org.apache.calcite.rel.type.RelDataTyperesultTypeForInsert(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory, org.apache.calcite.rel.type.RelDataType validatedRowType, Map<String, Object> queryContext) SQL row type that would be emitted by theQueryMakerfromSqlEngine.buildQueryMakerForInsert(org.apache.druid.sql.destination.IngestDestination, org.apache.calcite.rel.RelRoot, org.apache.druid.sql.calcite.planner.PlannerContext).org.apache.calcite.rel.type.RelDataTyperesultTypeForSelect(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory, org.apache.calcite.rel.type.RelDataType validatedRowType, Map<String, Object> queryContext) SQL row type that would be emitted by theQueryMakerfromSqlEngine.buildQueryMakerForSelect(org.apache.calcite.rel.RelRoot, org.apache.druid.sql.calcite.planner.PlannerContext).voidvalidateContext(Map<String, Object> queryContext) Validates a provided query context.Methods 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.run.SqlEngine
cancelQuery, getQueries, getQueryReport, initContextMap
-
Field Details
-
INSTANCE
-
-
Method Details
-
name
Description copied from interface:SqlEngineName of this engine. Appears in user-visible messages. -
featureAvailable
Description copied from interface:SqlEngineWhether a feature applies to this engine or not. Most callers should usePlannerContext.featureAvailable(EngineFeature)instead, which also checks feature flags in context parameters.- Specified by:
featureAvailablein interfaceSqlEngine
-
validateContext
Description copied from interface:SqlEngineValidates a provided query context. Returns quietly if the context is OK; throwsValidationExceptionif the context has a problem.- Specified by:
validateContextin interfaceSqlEngine
-
resultTypeForSelect
public org.apache.calcite.rel.type.RelDataType resultTypeForSelect(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory, org.apache.calcite.rel.type.RelDataType validatedRowType, Map<String, Object> queryContext) Description copied from interface:SqlEngineSQL row type that would be emitted by theQueryMakerfromSqlEngine.buildQueryMakerForSelect(org.apache.calcite.rel.RelRoot, org.apache.druid.sql.calcite.planner.PlannerContext). Called for SELECT. Not called for EXPLAIN, which is handled by the planner itself.- Specified by:
resultTypeForSelectin interfaceSqlEngine- Parameters:
typeFactory- type factoryvalidatedRowType- row type from Calcite's validatorqueryContext- query context, in case that affects the result type
-
resultTypeForInsert
public org.apache.calcite.rel.type.RelDataType resultTypeForInsert(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory, org.apache.calcite.rel.type.RelDataType validatedRowType, Map<String, Object> queryContext) Description copied from interface:SqlEngineSQL row type that would be emitted by theQueryMakerfromSqlEngine.buildQueryMakerForInsert(org.apache.druid.sql.destination.IngestDestination, org.apache.calcite.rel.RelRoot, org.apache.druid.sql.calcite.planner.PlannerContext). Called for INSERT and REPLACE. Not called for EXPLAIN, which is handled by the planner itself.- Specified by:
resultTypeForInsertin interfaceSqlEngine- Parameters:
typeFactory- type factoryvalidatedRowType- row type from Calcite's validatorqueryContext- query context, in case that affects the result type
-
buildQueryMakerForSelect
public QueryMaker buildQueryMakerForSelect(org.apache.calcite.rel.RelRoot relRoot, PlannerContext plannerContext) Description copied from interface:SqlEngineCreate aQueryMakerfor a SELECT query.- Specified by:
buildQueryMakerForSelectin interfaceSqlEngine- Parameters:
relRoot- planned and validated relplannerContext- context for this query- Returns:
- an executor for the provided query
-
buildQueryMakerForInsert
public QueryMaker buildQueryMakerForInsert(IngestDestination destination, org.apache.calcite.rel.RelRoot relRoot, PlannerContext plannerContext) Description copied from interface:SqlEngineCreate aQueryMakerfor an INSERT ... SELECT query.- Specified by:
buildQueryMakerForInsertin interfaceSqlEngine- Parameters:
destination- destination for the INSERT portion of the queryrelRoot- planned and validated rel for the SELECT portion of the queryplannerContext- context for this query- Returns:
- an executor for the provided query
-
getSqlStatementFactory
Description copied from interface:SqlEngineReturns aSqlStatementFactorywhich uses this engine to create statements.- Specified by:
getSqlStatementFactoryin interfaceSqlEngine
-