[ https://issues.apache.org/jira/browse/CALCITE-896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Haisheng Yuan updated CALCITE-896: ---------------------------------- Comment: was deleted (was: It seems like the patch in this PR triggered a bug in rule matching, the ProjectMergeRule and ProjectFilterTransposeRule matched indefinitely, generates new Projects and new Filters, until timeout. See the screenshot. !node.png! ) > 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)