This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
commit 2001689b1d6bf467c7cefce409487e62eeebfa8a Author: AKIRA <33112463+kikyou1...@users.noreply.github.com> AuthorDate: Fri Jan 13 19:42:12 2023 +0800 [fix](planner) move join reorder to the single node planner (#15817) Reorder in analyze phase would produce a stmt which its corresponding SQL could not be analyzed correctly and cause an analyze exception that may be happened in the stmt rewrite, since the rewriter will reset and reanalyze the rewritten stmt. --- fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java | 6 +----- .../src/main/java/org/apache/doris/planner/SingleNodePlanner.java | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java index fbb89c0fca..2548136966 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java @@ -569,10 +569,6 @@ public class SelectStmt extends QueryStmt { if (needToSql) { sqlString = toSql(); } - if (analyzer.enableStarJoinReorder()) { - LOG.debug("use old reorder logical in select stmt"); - reorderTable(analyzer); - } resolveInlineViewRefs(analyzer); @@ -764,7 +760,7 @@ public class SelectStmt extends QueryStmt { } } - protected void reorderTable(Analyzer analyzer) throws AnalysisException { + public void reorderTable(Analyzer analyzer) throws AnalysisException { List<Pair<TableRef, Long>> candidates = Lists.newArrayList(); ArrayList<TableRef> originOrderBackUp = Lists.newArrayList(fromClause.getTableRefs()); // New pair of table ref and row count diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java b/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java index 5ec1180b30..e6ab97d2a4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java @@ -1116,6 +1116,11 @@ public class SingleNodePlanner { return createConstantSelectPlan(selectStmt, analyzer); } + if (analyzer.enableStarJoinReorder()) { + LOG.debug("use old reorder logical in select stmt"); + selectStmt.reorderTable(analyzer); + } + // Slot materialization: // We need to mark all slots as materialized that are needed during the execution // of selectStmt, and we need to do that prior to creating plans for the TableRefs --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org