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 Fri, 25 Aug 2017 18:45:05 GMT
Philip Zeyliger has uploaded a new change for review.

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

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, 200 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/29/7829/1
-- 
To view, visit http://gerrit.cloudera.org:8080/7829
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id91ca968a0c0be44e1ec54ad8602f91a5cb2e0e5
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Philip Zeyliger <philip@cloudera.com>

Mime
View raw message