[
https://issues.apache.org/jira/browse/CALCITE-896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16784898#comment-16784898
]
Haisheng Yuan commented on CALCITE-896:
---------------------------------------
I have updated the pull request to address comments, can you take another look?
thanks.
> 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
> Priority: Major
> Labels: pull-request-available
> Attachments: node.png
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)