Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.1.0, 4.0.0
-
None
-
None
Description
create temporary table foo(col1 int, col2 int, col3 int, col5 int, col9 int) stored as orc; explain select count(1) from foo where CASE WHEN (col5 is not null) THEN (((col1 / col5) > (col9 / col3))) ELSE ((null > (col9 / col3))) END; explain select count(1), max((col9/col3) > null) from foo where CASE WHEN (col5 is not null) THEN (((col1 / col5) > (col9 / col3))) ELSE (((col9 / col3) > null)) END;
There's no sane way to write this query, but this is actually generated by CBO for an expression which looks like
case when t_w_firstyear.year_total > 0 then t_w_secyear.year_total / t_w_firstyear.year_total else null end > case when t_s_firstyear.year_total > 0 then t_s_secyear.year_total / t_s_firstyear.year_total else null end
Attachments
Issue Links
- is related to
-
CALCITE-2555 RexSimplify: >=(true, null) could be simplified to null
- Closed