-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.25.0
-
Component/s: None
-
Labels:
Add a rule to merge a Project onto an Aggregate. In practice, it means that aggregate functions that are not used in the Project are removed from the Aggregate.
For example,
SELECT deptno, sum_sal FROM ( SELECT deptno, job, SUM(sal) AS sum_sal, MIN(ename) AS min_ename FROM emp GROUP BY deptno, job)
becomes
SELECT deptno, sum_sal FROM ( SELECT deptno, job, SUM(sal) AS sum_sal FROM emp GROUP BY deptno, job)
Note that min_ename is removed from the Aggregate (because it is not used by the Project). job is not used, but it remains because it is a GROUP BY key.
- relates to
-
CALCITE-1172 Add rule to flatten two Aggregate operators into one
-
- Closed
-
-
CALCITE-3957 AggregateMergeRule should merge SUM0 into COUNT even if GROUP BY is empty
-
- Closed
-
- links to