impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip Zeyliger (Code Review)" <ger...@cloudera.org>
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

    http://gerrit.cloudera.org:8080/7829

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.

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

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


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/29/7829/4
-- 
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: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Philip Zeyliger <philip@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <philip@cloudera.com>

Mime
View raw message