This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 2dbca7a688 [Fix](Planner) fix multi phase analysis failed in multi 
instance environment substitution (#22840)
2dbca7a688 is described below

commit 2dbca7a68874f257deac9b329a1f831fe2b2856c
Author: LiBinfeng <[email protected]>
AuthorDate: Wed Aug 16 16:46:26 2023 +0800

    [Fix](Planner) fix multi phase analysis failed in multi instance 
environment substitution (#22840)
    
    Problem:
    When executing group_concat with order by inside in view, column can not be 
found when analyze.
    
    Example:
    create view if not exists test_view as select group_concat(c1,',' order by 
c1 asc) from table_group_concat;
    select * from test_view;
    it will return an error like: "can not find c1 in table_list"
    
    Reason:
    When we executing this sql in multi-instance environment, Planner would try 
to create plan in multi phase
    aggregation. And because we analyze test_view independent with tables 
outside view. So we can not get
    table informations inside view.
    
    Solution:
    Substitute order by expression of merge aggregation expressions.
---
 fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java
index e4e3170379..5d00144f05 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java
@@ -176,6 +176,9 @@ public class AggregationNode extends PlanNode {
         // to our input; our conjuncts don't get substituted because they 
already
         // refer to our output
         outputSmap = getCombinedChildSmap();
+        if (aggInfo.isMerge()) {
+            aggInfo.substitute(aggInfo.getIntermediateSmap(), analyzer);
+        }
         aggInfo.substitute(outputSmap, analyzer);
 
         // assert consistent aggregate expr and slot materialization


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to