以一条SQL的执行过程为例:
select count(*),siteid from table1 where siteid + 1 > 0 group by siteid ;
FE 端:
MysqlServer =>
ConnectScheduler =>
ConnectProcessor handleQuery() {
List<StatementBase> stmts = analyze(originStmt); //词法解析,语法解析
executor = new StmtExecutor(ctx, parsedStmt);
ctx.setExecutor(executor);
executor.execute();
}
=> StmtExecutor {
public void execute(TUniqueId queryId) throws Exception {
analyze(context.getSessionVariable().toThrift());
}
public void analyze(TQueryOptions tQueryOptions) throws UserException {
parse();
if (parsedStmt instanceof QueryStmt){...
analyzeAndGenerateQueryPlan(tQueryOptions);
}
}
/**
* 生成单机版执行计划
*/
private void analyzeAndGenerateQueryPlan(TQueryOptions tQueryOptions) throws UserException {
// create plan
planner =

本文深入探讨了DORIS SQL的执行过程,从StmtExecutor开始,详细阐述了如何在BE端进行处理,揭示了SQL在DORIS系统内部的工作原理。
最低0.47元/天 解锁文章
3247

被折叠的 条评论
为什么被折叠?



