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

Expand rule of `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

    XMLWordPrintableJSON

Details

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

    Description

      Using calcite'sĀ SubstitutionVisitor, we need do a lot work aboutĀ canonicalizing relnode.

      Some sql should be simplified.

      -- origin sql
      select deptno, salary, max(salary), min(commission) 
      from emps 
      group by deptno, salary
      
      -- simplified
      select deptno, salary, salary as expr, min(commission) 
      from emps 
      group by deptno, salary

      It should be simplified, but I didn't find any rule to simplify it.

      This issue is related to CALCITE-4857

      Attachments

        Issue Links

          Activity

            People

              wojustme Xurenhe
              wojustme Xurenhe
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 2.5h
                  2.5h