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


The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
     new ec40b3ac22 [fix](fe)predicate is wrongly pushed through CUBE function 
(#16150)
ec40b3ac22 is described below

commit ec40b3ac22862c5a119db068070f9c7ac6d4f272
Author: starocean999 <40539150+starocean...@users.noreply.github.com>
AuthorDate: Sat Jan 28 11:25:26 2023 +0800

    [fix](fe)predicate is wrongly pushed through CUBE function (#16150)
    
    pick from master #15831
---
 .../src/main/java/org/apache/doris/planner/SingleNodePlanner.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

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 854da5ddcc..b5f50f9317 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
@@ -2667,8 +2667,9 @@ public class SingleNodePlanner {
                     //eg: select distinct c from ( select distinct c from 
table) t where c > 1;
                     continue;
                 }
-                if (stmt.getGroupByClause().isGroupByExtension()
-                        && 
stmt.getGroupByClause().getGroupingExprs().contains(sourceExpr)) {
+                if (sourceExpr.getFn() instanceof AggregateFunction) {
+                    isAllSlotReferToGroupBys = false;
+                } else if (stmt.getGroupByClause().isGroupByExtension()) {
                     // if grouping type is CUBE or ROLLUP will definitely 
produce null
                     if (stmt.getGroupByClause().getGroupingType() == 
GroupByClause.GroupingType.CUBE
                             || stmt.getGroupByClause().getGroupingType() == 
GroupByClause.GroupingType.ROLLUP) {
@@ -2684,9 +2685,6 @@ public class SingleNodePlanner {
                         }
                     }
                 }
-                if (sourceExpr.getFn() instanceof AggregateFunction) {
-                    isAllSlotReferToGroupBys = false;
-                }
             }
 
             if (isAllSlotReferToGroupBys) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to