-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.14.0, 1.0.0, 1.1.0
-
Fix Version/s: 1.2.0
-
Component/s: Logical Optimizer
-
Labels:None
Constant folding for queries don't kick in for some automatically generated query patterns which look like this.
hive> explain select count(1) from store_sales where (case ss_sold_date when '1998-01-01' then 1 else null end)=1;
This should get rewritten by pushing the equality into the case branches.
select count(1) from store_sales where (case ss_sold_date when '1998-01-01' then 1=1 else null=1 end);
Ending up with a simplified filter condition, resolving itself as
select count(1) from store_sales where ss_sold_date= '1998-01-01' ;
- is depended upon by
-
HIVE-10636 CASE comparison operator rotation optimization
-
- Closed
-
- is related to
-
CALCITE-727 Constant folding involving CASE and NULL
-
- Closed
-
- relates to
-
HIVE-9645 Constant folding case NULL equality
-
- Closed
-
-
HIVE-12735 Constant folding for WHEN/CASE expression does not set return type correctly
-
- Closed
-
-
HIVE-10716 Fold case/when udf for expression involving nulls in filter operator.
-
- Resolved
-
- links to