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

NPE in validate method of VolcanoPlanner

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.13.0
    • Fix Version/s: 1.14.0
    • Component/s: core
    • Labels:
      None

      Description

      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

      final RelMetadataQuery mq = root.getCluster().getMetadataQuery();
      

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jcamachorodriguez Jesus Camacho Rodriguez
                Reporter:
                jcamachorodriguez Jesus Camacho Rodriguez
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: