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

Case expression with constant condition generates IllegalStateException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Impala 2.9.0
    • Fix Version/s: Impala 2.9.0
    • Component/s: Frontend
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: