CatalogService catalog = getQueryTaskContext().getQueryMasterContext().getWorkerContext().getCatalog();
LogicalPlanner planner = new LogicalPlanner(catalog);
LogicalOptimizer optimizer = new LogicalOptimizer(systemConf);
Expr expr;
if (queryContext.isHiveQueryMode()) {
HiveQLAnalyzer HiveQLAnalyzer = new HiveQLAnalyzer();
expr = HiveQLAnalyzer.parse(sql);
} else {
SQLAnalyzer analyzer = new SQLAnalyzer();
expr = analyzer.parse(sql);
}
LogicalPlan plan = planner.createPlan(session, expr);