Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Remove Aggregate if grouping columns are unique and all functions are splittable. Currently AggregateRemoveRule is only applied if there are no aggregate functions. But we could optimize
select deptno, count(name) from dept group by deptno
to
select deptno, 1 from dept
because we know deptno is unique, name is not null, and a singleton count applied to a not null column evaluates to 1.
See AggregateJoinTransposeRule; it already makes use of SqlSplittableAggFunction.
Attachments
Issue Links
- is related to
-
CALCITE-751 Push aggregate with aggregate functions through join
- Closed
- links to