Jesus Camacho Rodriguez created CALCITE-1859:
------------------------------------------------
Summary: 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)