Description
When optimizing a RelNode as follows
VolcanoPlanner planner = ... RelNode input = ... Program optProgram = Programs.ofRules(...); optProgram.run(planner, input, targetTraits, ImmutableList.of(), ImmutableList.of());
we get a NullPointerException with the following stack trace if the log level is set to DEBUG:
java.lang.NullPointerException at org.apache.calcite.plan.volcano.VolcanoPlanner.validate(VolcanoPlanner.java:891) at org.apache.calcite.plan.volcano.VolcanoPlanner.register(VolcanoPlanner.java:866) at org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:883) at org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:101) at org.apache.calcite.rel.AbstractRelNode.onRegister(AbstractRelNode.java:336) at org.apache.calcite.plan.volcano.VolcanoPlanner.registerImpl(VolcanoPlanner.java:1496) at org.apache.calcite.plan.volcano.VolcanoPlanner.register(VolcanoPlanner.java:863) at org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:883) at org.apache.calcite.plan.volcano.VolcanoPlanner.changeTraits(VolcanoPlanner.java:548) at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:365)
The VolcanoPlanner.validate() method is only called from VolcanoPlanner.register() if DEBUG log level is enabled.