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

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

              • Assignee:
                jinxing6042@126.com Jin Xing
                Reporter:
                jinxing6042@126.com Jin Xing
              • Votes:
                0 Vote for this issue
                Watchers:
                2 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