Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1997

VolcanoPlanner.validate() causes NPE due to root == null on DEBUG log level

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.13.0
    • 1.14.0
    • core
    • None

    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.

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            fhueske Fabian Hueske
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: