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 666b131061..c1beae813b 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 @@ -391,6 +391,7 @@ public class AggregationNode extends PlanNode { } } allRequestIds.forEach(allUnRequestIds::remove); + groupingSlotIds.forEach(allUnRequestIds::remove); allUnRequestIds.forEach(result::remove); } return result; diff --git a/regression-test/data/correctness_p0/test_inlineview_with_project.out b/regression-test/data/correctness_p0/test_inlineview_with_project.out index fad0b3fe44..e6ed3ee570 100644 --- a/regression-test/data/correctness_p0/test_inlineview_with_project.out +++ b/regression-test/data/correctness_p0/test_inlineview_with_project.out @@ -26,3 +26,6 @@ -- !select5 -- 3 +-- !select5 -- +3 + diff --git a/regression-test/suites/correctness_p0/test_inlineview_with_project.groovy b/regression-test/suites/correctness_p0/test_inlineview_with_project.groovy index 78eb76b5c4..e68c2033e5 100644 --- a/regression-test/suites/correctness_p0/test_inlineview_with_project.groovy +++ b/regression-test/suites/correctness_p0/test_inlineview_with_project.groovy @@ -603,6 +603,67 @@ suite("test_inlineview_with_project") { ) as a; """ + qt_select5 """ + select + count(*) + from + ( + select + cast(random() * 10000000000000000 as bigint) as id, + ga.column1 as column1, + ga.column6 as column2, + CAST(count(CAST(ga.column1 AS CHAR)) AS CHAR) as column3 + from + ( + select + t1.id as id, + upper(t1.caseId) as column1, + t1.`timestamp` as column2, + lower(t1.content) as column6 + from + ( + select + id, + caseId, + content, + `timestamp` + from + ( + select + id, + caseId, + content, + `timestamp` + from + dr_user_test_t2 + ) aaa + ) t1 + left join ( + select + id, + caseId, + content, + `timestamp` + from + ( + select + id, + caseId, + content, + `timestamp` + from + dr_user_test_t2 + ) bbb + ) t2 on t1.id = t2.id + ) as ga + group by + ga.column1, + ga.column6 + ) as tda; + + + """ + sql """DROP TABLE IF EXISTS `dr_user_test_t1`;""" sql """DROP TABLE IF EXISTS `dr_user_test_t2`;""" }