You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2017/08/23 05:28:00 UTC
[jira] [Comment Edited] (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=16068045#comment-16068045 ]
Julian Hyde edited comment on CALCITE-1859 at 8/23/17 5:27 AM:
---------------------------------------------------------------
Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/a2faf47; thanks for checking [~julianhyde].
I have left the method call as it was, as only the first call might cause a real overhead (follow-up calls will just retrieve the RelMetadataQuery reference) and that way we do not have to deal with the different possible scenarios (sets empty, etc.)
was (Author: jcamachorodriguez):
Fixed in http://git-wip-us.apache.org/repos/asf/calcite/a2faf47 , thanks for checking [~julianhyde].
I have left the method call as it was, as only the first call might cause a real overhead (follow-up calls will just retrieve the RelMetadataQuery reference) and that way we do not have to deal with the different possible scenarios (sets empty, etc.)
> 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)