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

RelNode to SQL lost the distinct when doing window aggregation

    XMLWordPrintableJSON

Details

    Description

      The case see in: https://github.com/Aaaaaaron/calcite/tree/CALCITE-4411

      org.apache.calcite.rel.rel2sql.RelToSqlConverterTest#testConvertWindowToSql

       

      Query:  SELECT  count(distinct employee_id) over (order by hire_date) FROM  employee

      Expected: SELECT COUNT(DISTINCT employee_id) OVER (ORDER BY hire_date RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM foodmart.employee

      Actual: SELECT COUNT(employee_id) OVER (ORDER BY hire_date RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM foodmart.employee

      Attachments

        Issue Links

          Activity

            People

              Aron.tao Jiatao Tao
              Aron.tao Jiatao Tao
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 10m
                  3h 10m