Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3428

Refine RelMdColumnUniqueness for Filter by considering constant columns

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.22.0
    • Component/s: 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

            Activity

              People

              • Assignee:
                jinxing6042@126.com Jin Xing
                Reporter:
                jinxing6042@126.com Jin Xing
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m