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

Approximate and exact aggregate calls are recognized as the same during sql-to-rel conversion

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      For sql:

      SELECT empno, count(distinct ename)
      approx_count_distinct(ename)
      FROM emp
      GROUP BY empno
      

      After sql-to-rel conversion, the plan is:

      LogicalProject(EMPNO=[$0], EXPR$1=[$1], EXPR$2=[$1])
        LogicalAggregate(group=[{0}], EXPR$1=[COUNT(DISTINCT $1)])
          LogicalProject(EMPNO=[$0], ENAME=[$1])
            LogicalTableScan(table=[[CATALOG, SALES, EMP]])
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            danny0405 Danny Chen
            danny0405 Danny Chen
            Votes:
            0 Vote for this issue
            Watchers:
            3 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 - 50m
                50m

                Slack

                  Issue deployment