Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.14.0, 1.0.0, 1.1.0
-
None
Description
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' ;
Attachments
Attachments
Issue Links
- 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