Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
AggregateRemoveRule fails to remove the top Aggregate for below SQL
select mgr, sum(sum_sal) from (select mgr, deptno, sum(sal) sum_sal from sales.emp group by mgr, deptno) where deptno=100 group by mgr
The reason is that RelMdColumnUniqueness doesn't take the filtering condition into consideration when checking uniqueness of columns.
This PR proposes to refine RelMdColumnUniqueness for Filter, thus to strengthen AggregateRemoveRule.
Resolving this Jira will help a lot for CALCITE-3334 by removing the redundant compensation Aggregate when doing materialization matching
Attachments
Issue Links
- causes
-
CALCITE-3725 RelMetadataTest fails with NPE due to unsafe RelMetadataQuery.instance call
- Closed
- is related to
-
CALCITE-6044 RelMetadataQuery should regard single-row relational expressions as unique
- Closed
- links to