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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0-incubating
    • Component/s: None
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: