impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip Zeyliger (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5211: Simplifying ifnull conditional.
Date Wed, 06 Sep 2017 22:25:49 GMT
Hello Matthew Jacobs,

I'd like you to reexamine a change.  Please visit

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.

* 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.

* 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/
M fe/src/main/java/org/apache/impala/rewrite/
M fe/src/test/java/org/apache/impala/analysis/
3 files changed, 88 insertions(+), 25 deletions(-)

  git pull ssh:// refs/changes/29/7829/5
To view, visit
To unsubscribe, visit

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id91ca968a0c0be44e1ec54ad8602f91a5cb2e0e5
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Philip Zeyliger <>
Gerrit-Reviewer: Alex Behm <>
Gerrit-Reviewer: Matthew Jacobs <>
Gerrit-Reviewer: Philip Zeyliger <>

View raw message