Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
Impala 2.9.0
-
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.