Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-2113

Uninformative error message when combining SELECT DISTINCT with aggregate function in HAVING clause

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.2
    • Impala 2.5.0, Impala 2.3.2
    • None
    • Impala v2.2.0-cdh5.4.2 on CentOS 6.5

    Description

      As shown below, queries that combine SELECT DISTINCT with a HAVING clause (but without a GROUP BY clause) containing an aggregate function fail with an uninformative error message, rather than the expected "ERROR: AnalysisException: cannot combine SELECT DISTINCT with aggregate functions or GROUP BY".

      > select * from test2;
      Query: select * from test2
      +-------------+------+-----+
      | id          | num  | prt |
      +-------------+------+-----+
      | charlie     | NULL | t2  |
      | asdfssdfasd | NULL | tst |
      | asdfs       | NULL | tst |
      +-------------+------+-----+
      Fetched 3 row(s) in 0.39s
      
       > select distinct id from test2 having sum(num) > 0;
      Query: select distinct id from test2 having sum(num) > 0
      ERROR: AnalysisException: null
      CAUSED BY: IllegalStateException: null
      
      

      Attachments

        Activity

          People

            cchanning Chris Channing
            cflowers@varickmm.com_impala_259e Charlie Flowers
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: