[fix](planner) retain groupingSlotIds as materialized for aggregate (#33060)
This commit is contained in:
@ -391,6 +391,7 @@ public class AggregationNode extends PlanNode {
|
||||
}
|
||||
}
|
||||
allRequestIds.forEach(allUnRequestIds::remove);
|
||||
groupingSlotIds.forEach(allUnRequestIds::remove);
|
||||
allUnRequestIds.forEach(result::remove);
|
||||
}
|
||||
return result;
|
||||
|
||||
@ -26,3 +26,6 @@
|
||||
-- !select5 --
|
||||
3
|
||||
|
||||
-- !select5 --
|
||||
3
|
||||
|
||||
|
||||
@ -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`;"""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user