Hello Matthew Jacobs,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/7829
to look at the new patch set (#5).
Change subject: IMPALA-5211: Simplifying ifnull conditional.
......................................................................
IMPALA-5211: Simplifying ifnull conditional.
Re-writes ifnull(x, y) into if(x DISTINCT FROM y, x, NULL),
and simplifies the latter if x.equals(y).
We use "DISTINCT FROM" rather than "=" to handle gracefully
that, if x and y are null, we still want NULL to get returned.
Testing:
* Added new tests to ExprRewriteRulesTests for nullif and the if(x
distinct from y, ...) simplification.
* Adds an nvl2() test, incidentally.
* Confirmed (using EclEmma, which uses jococo engine) that coverage is good.
Questions:
* I think this means we can remove the NullIfExpr and friends
from the backend, since the FE has moved them away. I've not
done that yet.
* The re-write in FunctionCallExpr creates a NullLiteral of type
NULL. The types of the children aren't available yet. I haven't
yet figured out if that's the right thing to do.
Change-Id: Id91ca968a0c0be44e1ec54ad8602f91a5cb2e0e5
---
M fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
M fe/src/main/java/org/apache/impala/rewrite/SimplifyConditionalsRule.java
M fe/src/test/java/org/apache/impala/analysis/ExprRewriteRulesTest.java
3 files changed, 88 insertions(+), 25 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/29/7829/5
--
To view, visit http://gerrit.cloudera.org:8080/7829
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id91ca968a0c0be44e1ec54ad8602f91a5cb2e0e5
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Philip Zeyliger <[email protected]>
Gerrit-Reviewer: Alex Behm <[email protected]>
Gerrit-Reviewer: Matthew Jacobs <[email protected]>
Gerrit-Reviewer: Philip Zeyliger <[email protected]>