Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2007

java.sql.SQLException: Encountered exception in sub plan [0] execution

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5.0, 4.4.1
    • Labels:
      None

      Description

      During our tests, encountered NPE when there is no data in the table.

      MainThread|2/2 SELECT * FROM (SELECT ID, BIG_ID, DATE_ID FROM LARGE_TABLE AS A WHERE (A.ID % 5) = 0) AS A INNER JOIN (SELECT SEC_ID, SEC_TINY_ID, SEC_UNSIG_FLOAT_ID FROM SECONDARY_LARGE_TABLE AS B WHERE (B.SEC_ID % 5) = 0) AS B ON A.ID=B.SEC_ID WHERE A.DATE_ID > ALL (SELECT SEC_DATE_ID FROM SECONDARY_LARGE_TABLE LIMIT 100) AND B.SEC_UNSIG_FLOAT_ID = ANY (SELECT sec_unsig_float_id FROM SECONDARY_LARGE_TABLE WHERE SEC_ID > ALL (SELECT MIN (ID) FROM GRAMMAR_TABLE WHERE UNSIG_ID IS NULL) AND SEC_UNSIG_ID < ANY (SELECT DISTINCT(UNSIG_ID) FROM LARGE_TABLE WHERE UNSIG_ID<2500) LIMIT 1000) AND A.ID < 10000;
      MainThread|Error: Encountered exception in sub plan [0] execution. (state=,code=0)
      MainThread|java.sql.SQLException: Encountered exception in sub plan [0] execution.
      MainThread|at org.apache.phoenix.execute.HashJoinPlan.iterator(HashJoinPlan.java:156)
      MainThread|at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:245)
      MainThread|at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:235)
      MainThread|at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
      MainThread|at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:234)
      MainThread|at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1158)
      MainThread|at sqlline.Commands.execute(Commands.java:822)
      MainThread|at sqlline.Commands.sql(Commands.java:732)
      MainThread|at sqlline.SqlLine.dispatch(SqlLine.java:808)
      MainThread|at sqlline.SqlLine.runCommands(SqlLine.java:1711)
      MainThread|at sqlline.Commands.run(Commands.java:1285)
      MainThread|at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      MainThread|at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      MainThread|at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      MainThread|at java.lang.reflect.Method.invoke(Method.java:606)
      MainThread|at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
      MainThread|at sqlline.SqlLine.dispatch(SqlLine.java:804)
      MainThread|at sqlline.SqlLine.initArgs(SqlLine.java:613)
      MainThread|at sqlline.SqlLine.begin(SqlLine.java:656)
      MainThread|at sqlline.SqlLine.start(SqlLine.java:398)
      MainThread|at sqlline.SqlLine.main(SqlLine.java:292)
      MainThread|Caused by: java.lang.NullPointerException
      MainThread|at org.apache.phoenix.schema.types.PDataType.instantiatePhoenixArray(PDataType.java:1119)
      MainThread|at org.apache.phoenix.schema.types.PArrayDataType.instantiatePhoenixArray(PArrayDataType.java:614)
      MainThread|at org.apache.phoenix.execute.HashJoinPlan$WhereClauseSubPlan.execute(HashJoinPlan.java:283)
      MainThread|at org.apache.phoenix.execute.HashJoinPlan$1.call(HashJoinPlan.java:135)
      MainThread|at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      MainThread|at org.apache.phoenix.job.JobManager$InstrumentedJobFutureTask.run(JobManager.java:172)
      MainThread|at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      MainThread|at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      MainThread|at java.lang.Thread.run(Thread.java:745)
      MainThread|Aborting command set because "force" is false and command failed: "SELECT * FROM (SELECT ID, BIG_ID, DATE_ID FROM LARGE_TABLE AS A WHERE (A.ID % 5) = 0) AS A INNER JOIN (SELECT SEC_ID, SEC_TINY_ID, SEC_UNSIG_FLOAT_ID FROM SECONDARY_LARGE_TABLE AS B WHERE (B.SEC_ID % 5) = 0) AS B ON A.ID=B.SEC_ID WHERE A.DATE_ID > ALL (SELECT SEC_DATE_ID FROM SECONDARY_LARGE_TABLE LIMIT 100) AND B.SEC_UNSIG_FLOAT_ID = ANY (SELECT sec_unsig_float_id FROM SECONDARY_LARGE_TABLE WHERE SEC_ID > ALL (SELECT MIN (ID) FROM GRAMMAR_TABLE WHERE UNSIG_ID IS NULL) AND SEC_UNSIG_ID < ANY (SELECT DISTINCT(UNSIG_ID) FROM LARGE_TABLE WHERE UNSIG_ID<2500) LIMIT 1000) AND A.ID < 10000;"
      MainThread|Closing: org.apache.phoenix.jdbc.PhoenixConnection

        Attachments

        1. Phoenix-2007-v1.patch
          6 kB
          Alicia Ying Shu
        2. Phoenix-2007.patch
          7 kB
          Alicia Ying Shu

          Activity

            People

            • Assignee:
              aliciashu Alicia Ying Shu
              Reporter:
              aliciashu Alicia Ying Shu
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: