Impala Public Jenkins has submitted this change and it was merged. 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 and hardcoded the list of ifnull aliases. 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. * Added a simple test case to the PlannerTest infrastructure. * I ran the relevant test with code coverage using "mvn -Dtest=ExprRewriteRulesTest -Djacoco.skip=false test". Coverage of SimplifyConditionalsRule.java is very strong. There's one pre-existing "return expr" in simplifyCompoundPredicate that's not covered, and almost all the rest are preconditions checks. Change-Id: I9e4b8bf6fedd595f9ea54ffb30fc71a058c7f16c Reviewed-on: http://gerrit.cloudera.org:8080/7781 Reviewed-by: Alex Behm <[email protected]> Tested-by: Impala Public Jenkins --- 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, 39 insertions(+), 5 deletions(-) Approvals: Impala Public Jenkins: Verified Alex Behm: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/7781 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e4b8bf6fedd595f9ea54ffb30fc71a058c7f16c Gerrit-PatchSet: 8 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Philip Zeyliger <[email protected]> Gerrit-Reviewer: Alex Behm <[email protected]> Gerrit-Reviewer: Dan Hecht <[email protected]> Gerrit-Reviewer: Henry Robinson <[email protected]> Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Matthew Jacobs <[email protected]> Gerrit-Reviewer: Philip Zeyliger <[email protected]>
