You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/08/14 01:32:00 UTC

[jira] [Commented] (IMPALA-7419) NullPointerException in SimplifyConditionalsRule

    [ https://issues.apache.org/jira/browse/IMPALA-7419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16579117#comment-16579117 ] 

ASF subversion and git services commented on IMPALA-7419:
---------------------------------------------------------

Commit b07a65a67afe1ee69f0f8983293671a98aaa04bd in impala's branch refs/heads/master from [~twmarshall]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=b07a65a ]

IMPALA-7419: Fix NullPointerException in SimplifyConditionalsRule

In SimplifyConditionalsRule, when simplifying a 'coalesce' where the
result is another coalesce with some children removed, we create a new
Expr for the new coalesce but previously were not analyzing the new
Expr.

This causes problems if the simplified Expr contains an aggregate
function, as we check to make sure the simplification didn't eliminate
any aggregates and the check expects the Expr to be analyzed.

The solution is to analyze the new Expr before performing the check
for aggregates.

Testing:
- Added a FE test to ExprRewriteRulesTest

Change-Id: I5d066b48c2824cc09ce21260ad06b3d50b14c54a
Reviewed-on: http://gerrit.cloudera.org:8080/11179
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> NullPointerException in SimplifyConditionalsRule
> ------------------------------------------------
>
>                 Key: IMPALA-7419
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7419
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 3.1.0
>            Reporter: Thomas Tauber-Marshall
>            Assignee: Thomas Tauber-Marshall
>            Priority: Critical
>
> Found by the query generator:
> {noformat}
> SELECT
> COALESCE((-311) * (NULL), MIN(DISTINCT tinyint_col), 42)
> FROM functional.alltypes
> {noformat}
> {noformat}
> java.lang.NullPointerException 
>         at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187) 
>         at org.apache.impala.analysis.FunctionCallExpr.isAggregateFunction(FunctionCallExpr.java:238) 
>         at org.apache.impala.analysis.Expr$1.apply(Expr.java:100) 
>         at org.apache.impala.analysis.Expr$1.apply(Expr.java:97) 
>         at org.apache.impala.common.TreeNode.contains(TreeNode.java:162) 
>         at org.apache.impala.rewrite.SimplifyConditionalsRule.apply(SimplifyConditionalsRule.java:84) 
>         at org.apache.impala.rewrite.ExprRewriter.applyRuleBottomUp(ExprRewriter.java:85) 
>         at org.apache.impala.rewrite.ExprRewriter.applyRuleRepeatedly(ExprRewriter.java:71) 
>         at org.apache.impala.rewrite.ExprRewriter.rewrite(ExprRewriter.java:55) 
>         at org.apache.impala.analysis.SelectList.rewriteExprs(SelectList.java:97) 
>         at org.apache.impala.analysis.SelectStmt.rewriteExprs(SelectStmt.java:892) 
>         at org.apache.impala.analysis.AnalysisContext.analyze(AnalysisContext.java:446) 
>         at org.apache.impala.analysis.AnalysisContext.analyzeAndAuthorize(AnalysisContext.java:408) 
>         at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1035) 
>         at org.apache.impala.service.JniFrontend.createExecRequest(JniFrontend.java:165) 
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org