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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

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

          Activity

            People

            • Assignee:
              danny0405 Danny Chen
              Reporter:
              hyuan Haisheng Yuan

              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

                  Issue deployment