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

Allow ORDER BY aggregate function in SELECT DISTINCT, provided that it occurs in SELECT clause

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.2.0-incubating
    • None
    • None

    Description

      For example, the query

      select distinct count(empno) from emp
      group by empno
      order by 1
      

      gave:

      org.apache.calcite.sql.validate.SqlValidatorException <init>
      SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Expression 'COUNT(`EMP`.`EMPNO`)' is not in the select clause

      Attachments

        1. CALCITE-634.1.patch
          3 kB
          Sean Hsuan-Yi Chu

        Activity

          People

            julianhyde Julian Hyde
            seanhychu Sean Hsuan-Yi Chu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: