You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Vincent Tran (JIRA)" <ji...@apache.org> on 2017/07/14 13:10:00 UTC

[jira] [Resolved] (IMPALA-5524) NullPointerException during planning with DISABLE_UNSAFE_SPILLS=TRUE

     [ https://issues.apache.org/jira/browse/IMPALA-5524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent Tran resolved IMPALA-5524.
----------------------------------
    Resolution: Fixed

IMPALA-5524: Fixes NPE during planning with DISABLE_UNSAFE_SPILLS=1
This change will avoid a NPE during query planning under the following
conditions:
- DISABLE_UNSAFE_SPILLS is TRUE or 1
- All tables involved in the query have stats

Change-Id: Iccae7fdeaf0ade0b8728a7d249981c8270e8c327
Reviewed-on: http://gerrit.cloudera.org:8080/7219
Reviewed-by: Tim Armstrong <ta...@cloudera.com>
Tested-by: Impala Public Jenkins

> NullPointerException during planning with DISABLE_UNSAFE_SPILLS=TRUE
> --------------------------------------------------------------------
>
>                 Key: IMPALA-5524
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5524
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 2.6.0, Impala 2.7.0, Impala 2.8.0
>            Reporter: Alexander Behm
>            Assignee: Vincent Tran
>              Labels: newbie
>
> Setting the DISABLE_UNSAFE_SPILLS query option to TRUE leads to a NullPointerException during query planning if all tables of the query have stats.
> Repro:
> {code}
> create table t (i int);
> compute stats t;
> set disable_unsafe_spills=true;
> select * from t;
> ERROR: NullPointerException: null
> {code}
> Stack:
> {code}
> I0615 23:06:54.581377 11228 jni-util.cc:176] java.lang.NullPointerException
> 	at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1027)
> 	at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1104)
> 	at org.apache.impala.service.JniFrontend.createExecRequest(JniFrontend.java:156)
> {code}
> The problem is here:
> {code}
>     boolean disableSpilling =
>         queryCtx.client_request.query_options.isDisable_unsafe_spills()
>           && !queryCtx.tables_missing_stats.isEmpty() <-- tables_missing_stats can be null
>           && !analysisResult.getAnalyzer().hasPlanHints();
>     queryCtx.setDisable_spilling(disableSpilling);
> {code}
> The reason why "tables_missing_stats" is null can be found in Frontend.createPlanExecInfo():
> {code}
> ...
>     // Clear pre-existing lists to avoid adding duplicate entries in FE tests.
>     queryCtx.unsetTables_missing_stats(); <-- sets to null
>     queryCtx.unsetTables_with_corrupt_stats();
>     for (TTableName tableName: tablesMissingStats) {
>       queryCtx.addToTables_missing_stats(tableName);
>     }
>     for (TTableName tableName: tablesWithCorruptStats) {
>       queryCtx.addToTables_with_corrupt_stats(tableName);
>     }
>     for (TTableName tableName: tablesWithMissingDiskIds) {
>       queryCtx.addToTables_missing_diskids(tableName);
>     }
> ...
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)