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

Distinct can be removed for MIN/MAX/BIT_OR/BIT_AND aggregate functions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.20.0
    • 1.21.0
    • core

    Description

      For the following query:

      select a, min(distinct b), bit_or(distinct c) from foo group by a;
      

      Currently Calcite still preserve the distinct for these aggregate functions, but DISTINCT is not meaningful with MIN/MAX and is available for ISO compatibility only. We can safely remove distinct and get more optimization opportunities.

      Attachments

        Issue Links

          Activity

            People

              danny0405 Danny Chen
              hyuan Haisheng Yuan
              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 - 3h 20m
                  3h 20m