You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2017/06/27 15:41:00 UTC

[jira] [Commented] (CALCITE-1859) NPE in validate method of VolcanoPlanner

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

Jesus Camacho Rodriguez commented on CALCITE-1859:
--------------------------------------------------

[~julianhyde], I have created a PR for this:
https://github.com/apache/calcite/pull/483
Please, could you review it? It is a very simple fix, all current tests pass and verified that it fixes the issue on Hive side, however I could not find a straightforward way to add a test. Thanks

> NPE in validate method of VolcanoPlanner
> ----------------------------------------
>
>                 Key: CALCITE-1859
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1859
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.13.0
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>            Priority: Critical
>             Fix For: 1.14.0
>
>
> CALCITE-1812 introduced the following line in {{validate}} method in VolcanoPlanner:
> https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java#L891
> {code}
> final RelMetadataQuery mq = root.getCluster().getMetadataQuery();
> {code}
> {{validate}} might be called as part of the {{setRoot}} logic before _root_ is set, thus we are hitting a NPE. Workaround was easy as {{validate}} is only called in logging DEBUG level (I guess that is why we did not see this issue before), but this JIRA will fix the issue by retrieving the RelMetadataQuery in _validate_ only when needed.



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