Julian Hyde created CALCITE-896:
-----------------------------------
Summary: Remove Aggregate if grouping columns are unique and all
functions are splittable
Key: CALCITE-896
URL: https://issues.apache.org/jira/browse/CALCITE-896
Project: Calcite
Issue Type: Bug
Reporter: Julian Hyde
Assignee: Julian Hyde
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
{code}select deptno, count(name) from dept group by deptno{code}
to
{code}select deptno, 1 from dept{code}
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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)