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

AggregateOnCalcToAggregateUnifyRule ignores Project incorrectly when there's missing grouping or mapping breaks ordering

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.22.0
    • core

    Description

      CALCITE-3087 fixed AggregateOnProjectToAggregateUnifyRule when mapping under Aggregate breaks ordering. But it fails when there's missing grouping in query compared with target.
      Below matching fails:

      MV:
       select empid, deptno, name, count(*) from emps
       group by empid, deptno, name
      Query:
       select name, empid, count(*) from emps group by name, empid

      Note that – comparing groupings in MV (empid, deptno, name) and groupings in query (name, empid), deptno is missed and ordering is broken

      Attachments

        Issue Links

          Activity

            People

              jinxing6042@126.com Jin Xing
              jinxing6042@126.com Jin Xing
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 2h 50m
                  2h 50m