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

Frameworks gives NPE when FrameworkConfig has no default schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0-incubating
    • core
    • None

    Description

      During testing of 1.4-SNAPSHOT on Hive, we hit the Exception with the following stacktrace in all our tests:

      java.lang.NullPointerException
              at org.apache.calcite.jdbc.CalciteSchema.from(CalciteSchema.java:316)
              at org.apache.calcite.tools.Frameworks$1.apply(Frameworks.java:109)
              at org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalcitePrepareImpl.java:880)
              at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:147)
              at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:105)
              at org.apache.hadoop.hive.ql.parse.CalcitePlanner.getOptimizedAST(CalcitePlanner.java:614)
              at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:249)
              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10130)
              at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:209)
              at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:240)
      ...
      

      The problem is that the FrameworkConfig defaultSchema is null. Thus, a NPE is thrown after hitting this piece of code in Frameworks:

      final CalciteSchema schema =
        CalciteSchema.from(config.getDefaultSchema());
      

      The apply method was changed in CALCITE-748.

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            jcamacho Jesús Camacho Rodríguez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: