[
https://issues.apache.org/jira/browse/CALCITE-896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Haisheng Yuan resolved CALCITE-896.
-----------------------------------
Resolution: Fixed
Assignee: Haisheng Yuan
Fix Version/s: 1.20.0
Pushed to master:
https://github.com/apache/calcite/commit/3ed76375fd05b29db17d6117aa0487ccb85f45ba
Thanks for your review, [~julianhyde]!
> 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: Haisheng Yuan
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.20.0
>
> Attachments: node.png
>
> Time Spent: 1h 20m
> 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)