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

    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

          Issue Links

            Activity

              People

              • Assignee:
                danny0405 Danny Chen
                Reporter:
                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