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

Case expression with constant condition generates IllegalStateException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Impala 2.9.0
    • Impala 2.9.0
    • Frontend
    • None

    Description

      The following SQLs generate an IllegalStateException:

      select distinct case when true then id else 0 end from functional.alltypes;
      select case when true then id else 0 end from functional.alltypes group by id;

      These SQLs do not produce an error:

      select distinct case when true then 0 else id end from functional.alltypes;
      select distinct case when id=id then id else 0 end from functional.alltypes;
      select case when true then id else 0 end from functional.alltypes;

      This seems to be related to the optimization for case expressions with a constant condition interacting with distinct.

      Attachments

        Activity

          People

            twmarshall Thomas Tauber-Marshall
            joemcdonnell Joe McDonnell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: