Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.36.0
Description
The optimization rule does not seem to consider the groupSets at all.
The following two queries produce the same resulting plan:
select count(distinct deptno) as cd, count(*) as c from emp group by cube(deptno)
select count(distinct deptno) as cd, count(*) as c from emp group by deptno
(Notice that one query has a cube, while the other one doesn't)
The produced plan is:
LogicalProject(CD=[$1], C=[$2]), id = 196 LogicalAggregate(group=[{0}], CD=[COUNT($0)], C=[$SUM0($1)]), id = 201 LogicalAggregate(group=[{0}], C=[COUNT()]), id = 198 LogicalProject(DEPTNO=[$8]), id = 192 LogicalTableScan(table=[[schema, EMP]]), id = 163
Attachments
Issue Links
- is related to
-
CALCITE-5328 The rule of AGGREGATE_EXPAND_DISTINCT_AGGREGATES_TO_JOIN throws error when meeting the rollup's query
- Open
-
CALCITE-732 Implement multiple distinct-COUNT using GROUPING SETS
- Closed
- relates to
-
CALCITE-6335 Quidem tests should allow specifying optimization passes to apply to programs
- Open
- links to