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

Add support for filters in AggregateExpandWithinDistinctRule

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 1.28.0
    • None

    Description

      Currently, AggregateExpandWithinDistinctRule does not fire if any of the aggregate calls in the aggregate have a filter. We should support filters.

      For example, the following query will not be handled by the current rule due to the FILTER clause:

      SELECT deptno,
          SUM(sal),
          SUM(sal) WITHIN DISTINCT (job) FILTER (WHERE ename LIKE 'A%')
      FROM emp
      GROUP BY deptno
      

      Attachments

        Issue Links

          Activity

            People

              wnoble Will Noble
              wnoble Will Noble
              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 - 10m
                  10m