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 conditionals (istrue, nullif, etc.)
Date Tue, 05 Sep 2017 17:39:48 GMT
Hello Matthew Jacobs,

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

to look at the new patch set (#4).

Change subject: IMPALA-5211: Simplifying conditionals (istrue, nullif, etc.)

IMPALA-5211: Simplifying conditionals (istrue, nullif, etc.)

This commit simplifies the following conditional functions:
 * istrue
 * isfalse
 * isnottrue
 * isnotfalse
 * zeroifnull
 * nullifzero
 * nullvalue
 * nonnullvalue
 * nullif

Most of these simplifications work when the arguments to
these functions are literals. The one exception is
that nullif(x, y) simplifies to NULL when x.equals(y)
as expressions. This is valid since nullif(null, null)=null.
This simplification has not been applied to the equivalent
"case x=x then null else null".

In terms of the implementation is a bit of a toss-up between re-writing
these into their equivalent case statements or simplifying them here.

* Added new tests to ExprRewriteRulesTest
* Confirmed (using EclEmma, which uses jococo engine) that coverage is

Change-Id: Id91ca968a0c0be44e1ec54ad8602f91a5cb2e0e5
M fe/src/main/java/org/apache/impala/rewrite/
M fe/src/test/java/org/apache/impala/analysis/
2 files changed, 208 insertions(+), 18 deletions(-)

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id91ca968a0c0be44e1ec54ad8602f91a5cb2e0e5
Gerrit-PatchSet: 4
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