You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Philip Zeyliger (Code Review)" <ge...@cloudera.org> on 2017/08/23 16:48:24 UTC

[Impala-ASF-CR] IMPALA-5211: Simplifying ifnull/isnull/nvl where conditional is a literal.

Hello Dan Hecht,

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

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

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

Change subject: IMPALA-5211: Simplifying ifnull/isnull/nvl where conditional is a literal.
......................................................................

IMPALA-5211: Simplifying ifnull/isnull/nvl where conditional is a literal.

Added code to simplify ifnull(<literal>, <x>) to x if <literal> is NULL
or <literal> if it's not NULL. Removed a few unused Java imports.

I did the naive thing for recognizing that ifnull has variants.
It looks like common/function-registry/impala_functions.py is
used to generate ScalarBuiltins.java, and a similar approach could
be taken.

There are more conditional functions where similar approaches
can be taken; IMPALA-5211 is not yet complete with just this patch.

Testing:
* Added new cases to existing unit test.

Change-Id: I9e4b8bf6fedd595f9ea54ffb30fc71a058c7f16c
---
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, 32 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/81/7781/3
-- 
To view, visit http://gerrit.cloudera.org:8080/7781
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9e4b8bf6fedd595f9ea54ffb30fc71a058c7f16c
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dh...@cloudera.com>