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

Group by subquery causes Java NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.0
    • 1.16.0
    • Storage - JDBC
    • None

    Description

      select count from postgres.public.tjoin2 group by ( select c1 from postgres.public.tjoin1 where rnum = 0)

      Error: VALIDATION ERROR: java.lang.NullPointerException

      [Error Id: d3453085-d77c-484e-8df7-f5fadc7bcc7d on centos1:31010]

      (org.apache.calcite.tools.ValidationException) java.lang.NullPointerException
      org.apache.calcite.prepare.PlannerImpl.validate():189
      org.apache.calcite.prepare.PlannerImpl.validateAndGetType():198
      org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode():451
      org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert():198
      org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():167
      org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan():199
      org.apache.drill.exec.work.foreman.Foreman.runSQL():924
      org.apache.drill.exec.work.foreman.Foreman.run():250
      java.util.concurrent.ThreadPoolExecutor.runWorker():1142
      java.util.concurrent.ThreadPoolExecutor$Worker.run():617
      java.lang.Thread.run():745
      Caused By (java.lang.NullPointerException) null
      org.apache.calcite.sql.validate.SqlValidatorUtil$ExpansionAndDeepCopier.visit():633
      org.apache.calcite.sql.validate.SqlValidatorUtil$ExpansionAndDeepCopier.visit():619
      org.apache.calcite.sql.SqlIdentifier.accept():274
      org.apache.calcite.sql.validate.SqlValidatorUtil$DeepCopier.visit():676
      org.apache.calcite.sql.validate.SqlValidatorUtil$DeepCopier.visit():663
      org.apache.calcite.sql.SqlNodeList.accept():152
      org.apache.calcite.sql.util.SqlShuttle$CallCopyingArgHandler.visitChild():134
      org.apache.calcite.sql.util.SqlShuttle$CallCopyingArgHandler.visitChild():101
      org.apache.calcite.sql.SqlOperator.acceptCall():720
      org.apache.calcite.sql.SqlSelectOperator.acceptCall():128
      org.apache.calcite.sql.validate.SqlValidatorUtil$DeepCopier.visitScoped():686
      org.apache.calcite.sql.validate.SqlScopedShuttle.visit():50
      org.apache.calcite.sql.validate.SqlScopedShuttle.visit():32
      org.apache.calcite.sql.SqlCall.accept():130
      org.apache.calcite.sql.validate.SqlValidatorUtil$DeepCopier.visit():676
      org.apache.calcite.sql.validate.SqlValidatorUtil$DeepCopier.visit():663
      org.apache.calcite.sql.SqlNodeList.accept():152
      org.apache.calcite.sql.validate.SqlValidatorUtil$ExpansionAndDeepCopier.copy():626
      org.apache.calcite.sql.validate.AggregatingSelectScope.<init>():92
      org.apache.calcite.sql.validate.SqlValidatorImpl.registerQuery():2200
      org.apache.calcite.sql.validate.SqlValidatorImpl.registerQuery():2122
      org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression():835
      org.apache.calcite.sql.validate.SqlValidatorImpl.validate():551
      org.apache.calcite.prepare.PlannerImpl.validate():187
      org.apache.calcite.prepare.PlannerImpl.validateAndGetType():198
      org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode():451
      org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert():198
      org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():167
      org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan():199
      org.apache.drill.exec.work.foreman.Foreman.runSQL():924
      org.apache.drill.exec.work.foreman.Foreman.run():250
      java.util.concurrent.ThreadPoolExecutor.runWorker():1142
      java.util.concurrent.ThreadPoolExecutor$Worker.run():617
      java.lang.Thread.run():745

      SQLState: null
      ErrorCode: 0

      create table TJOIN1 (RNUM integer not null , C1 integer, C2 integer);
      create table TJOIN2 (RNUM integer not null , C1 integer, C2 char(2));

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              the6campbells N Campbell
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: