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

Support materialized view recognition when query distinct aggregate on target GROUP BY column

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.27.0
    • None

    Description

      When query distinct aggregate on the column, which is in the group by list of target.
      Materialized view recognition should success.
      See this case.

      @Test void testQueryDistinctColumnInTargetGroupByList() {
          final String mv = ""
              + "select \"name\", \"deptno\" "
              + "from \"emps\" group by \"name\", \"deptno\"";
          final String query = ""
              + "select \"name\", count(distinct \"deptno\")\n"
              + "from \"emps\" group by \"name\"";
          sql(mv, query).ok();
        }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yanlin-Lynn Wang Yanlin
              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 - 2h 20m
                  2h 20m