Jesus Camacho Rodriguez created HIVE-23228:
----------------------------------------------
Summary: Missed optimization opportunity with equals and not equals
Key: HIVE-23228
URL: https://issues.apache.org/jira/browse/HIVE-23228
Project: Hive
Issue Type: Improvement
Components: CBO
Affects Versions: 4.0.0
Reporter: Jesus Camacho Rodriguez
Assignee: Jesus Camacho Rodriguez
After HIVE-23100 went in, there was a missed opportunity on the simplification
of an AND predicate containing equals and not equals clause, which can be seen
in ql/src/test/results/clientpositive/pcs.q.out .
{code}
filterExpr: ((key = 3) or (((((ds = '2000-04-08') or key is not
null) and (key = 2)) or ((ds <> '2000-04-08') and (key = 3))) and ((key + 5) >
0))) (type: boolean)
{code}
was replaced by:
{code}
filterExpr: ((key = 3) or (((((ds = '2000-04-08') or key is not
null) and (key = 2)) or ((ds <> '2000-04-08') and (key <> 2) and (key = 3)))
and ((key + 5) > 0))) (type: boolean)
{code}
Note the additional {{key <> 2}} in predicate below.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)