in iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java [391:477]
private IQueryExecution createQueryExecutionForTableModel(
final org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Statement statement,
final SqlParser sqlParser,
final IClientSession clientSession,
final MPPQueryContext queryContext,
final Metadata metadata,
final long timeOut,
final long startTime) {
queryContext.setTimeOut(timeOut);
queryContext.setStartTime(startTime);
if (statement instanceof DropDB
|| statement instanceof ShowDB
|| statement instanceof CreateDB
|| statement instanceof AlterDB
|| statement instanceof Use
|| statement instanceof CreateTable
|| statement instanceof DescribeTable
|| statement instanceof ShowTables
|| statement instanceof AddColumn
|| statement instanceof SetProperties
|| statement instanceof DropColumn
|| statement instanceof DropTable
|| statement instanceof SetTableComment
|| statement instanceof SetColumnComment
|| statement instanceof DeleteDevice
|| statement instanceof RenameColumn
|| statement instanceof RenameTable
|| statement instanceof ShowCluster
|| statement instanceof ShowRegions
|| statement instanceof ShowDataNodes
|| statement instanceof ShowConfigNodes
|| statement instanceof ShowAINodes
|| statement instanceof Flush
|| statement instanceof ClearCache
|| statement instanceof SetConfiguration
|| statement instanceof LoadConfiguration
|| statement instanceof SetSystemStatus
|| statement instanceof StartRepairData
|| statement instanceof StopRepairData
|| statement instanceof PipeStatement
|| statement instanceof RemoveDataNode
|| statement instanceof RemoveConfigNode
|| statement instanceof SubscriptionStatement
|| statement instanceof ShowCurrentSqlDialect
|| statement instanceof SetSqlDialect
|| statement instanceof ShowCurrentUser
|| statement instanceof ShowCurrentDatabase
|| statement instanceof ShowVersion
|| statement instanceof ShowVariables
|| statement instanceof ShowClusterId
|| statement instanceof ShowCurrentTimestamp
|| statement instanceof KillQuery
|| statement instanceof CreateFunction
|| statement instanceof DropFunction
|| statement instanceof ShowFunctions
|| statement instanceof RelationalAuthorStatement
|| statement instanceof MigrateRegion
|| statement instanceof ReconstructRegion
|| statement instanceof ExtendRegion
|| statement instanceof CreateTraining
|| statement instanceof ShowModels
|| statement instanceof RemoveRegion) {
return new ConfigExecution(
queryContext,
null,
executor,
statement.accept(
new TableConfigTaskVisitor(clientSession, metadata, accessControl), queryContext));
}
if (statement instanceof WrappedInsertStatement) {
((WrappedInsertStatement) statement).setContext(queryContext);
}
final TableModelPlanner tableModelPlanner =
new TableModelPlanner(
statement,
sqlParser,
metadata,
scheduledExecutor,
SYNC_INTERNAL_SERVICE_CLIENT_MANAGER,
ASYNC_INTERNAL_SERVICE_CLIENT_MANAGER,
statementRewrite,
logicalPlanOptimizers,
distributionPlanOptimizers,
accessControl,
dataNodeLocationSupplier);
return new QueryExecution(tableModelPlanner, queryContext, executor);
}