Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-7645

Query on tables from postgres INFORMATION_SCHEMA fails with NPE

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.17.0
    • Fix Version/s: Future
    • Component/s: None
    • Labels:
      None

      Description

      Steps to reproduce:

      1. Set up JDBC storage plugin to work with Postgres, as described here: https://drill.apache.org/docs/rdbms-storage-plugin/
      2. Run the following query:

      SELECT * FROM postgres1.`INFORMATION_SCHEMA`.`tables`;
      

      It fails with NPE:

      Error: SYSTEM ERROR: NullPointerException
      
      
      Please, refer to logs for more information.
      
      [Error Id: 897978fa-fd7d-4337-8a33-b8c18501e9c7 on user515050-pc:31010] (state=,code=0)
      

      Stack trace:

      Caused by: java.lang.NullPointerException: 
      	at org.apache.calcite.sql2rel.RelStructuredTypeFlattener$RewriteRexShuttle.removeDistinct(RelStructuredTypeFlattener.java:858)
      	at org.apache.calcite.sql2rel.RelStructuredTypeFlattener$RewriteRexShuttle.visitInputRef(RelStructuredTypeFlattener.java:850)
      	at org.apache.calcite.sql2rel.RelStructuredTypeFlattener$RewriteRexShuttle.visitInputRef(RelStructuredTypeFlattener.java:829)
      	at org.apache.calcite.rex.RexInputRef.accept(RexInputRef.java:112)
      	at org.apache.calcite.sql2rel.RelStructuredTypeFlattener.flattenProjection(RelStructuredTypeFlattener.java:685)
      	at org.apache.calcite.sql2rel.RelStructuredTypeFlattener.flattenProjections(RelStructuredTypeFlattener.java:583)
      	at org.apache.calcite.sql2rel.RelStructuredTypeFlattener.rewriteRel(RelStructuredTypeFlattener.java:504)
      	at .......(:0)
      	at org.apache.calcite.util.ReflectUtil.invokeVisitorInternal(ReflectUtil.java:257)
      	at org.apache.calcite.util.ReflectUtil.invokeVisitor(ReflectUtil.java:214)
      	at org.apache.calcite.util.ReflectUtil$1.invokeVisitor(ReflectUtil.java:464)
      	at org.apache.calcite.sql2rel.RelStructuredTypeFlattener$RewriteRelVisitor.visit(RelStructuredTypeFlattener.java:810)
      	at org.apache.calcite.sql2rel.RelStructuredTypeFlattener.rewrite(RelStructuredTypeFlattener.java:197)
      	at org.apache.calcite.sql2rel.SqlToRelConverter.flattenTypes(SqlToRelConverter.java:468)
      	at org.apache.drill.exec.planner.sql.conversion.SqlConverter.toRel(SqlConverter.java:223)
      	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToRel(DefaultSqlHandler.java:661)
      	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert(DefaultSqlHandler.java:198)
      	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:169)
      	at org.apache.drill.exec.planner.sql.DrillSqlWorker.getQueryPlan(DrillSqlWorker.java:283)
      	at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPhysicalPlan(DrillSqlWorker.java:163)
      	at org.apache.drill.exec.planner.sql.DrillSqlWorker.convertPlan(DrillSqlWorker.java:128)
      	at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:93)
      	at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:590)
      	at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:275)
      	... 1 common frames omitted
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              volodymyr Vova Vysotskyi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: