Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
Description
For the sql
select count(distinct x) cnt from( select distinct sal x from emp ) t
The distinct that in count can be removed.
LogicalAggregate(group=[{}], CNT=[COUNT($0)]) LogicalAggregate(group=[{0}]) LogicalProject(X=[$5]) LogicalTableScan(table=[[CATALOG, SALES, EMP]])
But `CoreRules#AGGREGATE_REMOVE` not support it, so there are two DISTINCT.
LogicalAggregate(group=[{}], CNT=[COUNT(DISTINCT $0)]) LogicalAggregate(group=[{0}]) LogicalProject(X=[$5]) LogicalTableScan(table=[[CATALOG, SALES, EMP]])
Attachments
Issue Links
- duplicates
-
CALCITE-6201 Merge Aggregate node if count distinct column has been deduplicated
- Resolved
- links to