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

NPE while running sql through file using psql

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.14.0, 5.0.0
    • Fix Version/s: 4.14.0, 5.0.0
    • Labels:
      None

      Description

      cat /tmp/test.sql
      CREATE TABLE IF NOT EXISTS QETEST (ID INTEGER NOT NULL PRIMARY KEY, A VARCHAR, B INTEGER);
      upsert into QETEST VALUES(1,'A',10);
      upsert into QETEST VALUES(2,'B',1000);
      upsert into QETEST VALUES(3,'A',20);
      upsert into QETEST VALUES(4,'A',100);
      upsert into QETEST VALUES(5,'B',9000);
      SELECT A||'_GROUP' AS GRP,SUM(B)||'_RESULT' AS SUM FROM QETEST GROUP BY A;
      DROP TABLE QETEST;

      bin/psql.py localhost /tmp/test.sql

      no rows upserted
      Time: 0.858 sec(s)
      
      1 row upserted
      Time: 0.04 sec(s)
      
      1 row upserted
      Time: 0.004 sec(s)
      
      1 row upserted
      Time: 0.006 sec(s)
      
      1 row upserted
      Time: 0.004 sec(s)
      
      1 row upserted
      Time: 0.004 sec(s)
      
      java.lang.NullPointerException: null value in entry: QUERY_I=null
      at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:235)
      at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:144)
      at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:182)
      at org.apache.phoenix.log.QueryLoggerUtil.getInitialDetails(QueryLoggerUtil.java:50)
      at org.apache.phoenix.log.QueryLoggerUtil.logInitialDetails(QueryLoggerUtil.java:36)
      at org.apache.phoenix.jdbc.PhoenixStatement.createQueryLogger(PhoenixStatement.java:1783)
      at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:176)
      at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:183)
      at org.apache.phoenix.jdbc.PhoenixConnection.executeStatements(PhoenixConnection.java:468)
      at org.apache.phoenix.util.PhoenixRuntime.executeStatements(PhoenixRuntime.java:348)
      at org.apache.phoenix.util.PhoenixRuntime.main(PhoenixRuntime.java:295)

      FYI James R. Taylor , if you see it a blocker for 4.14.

        Attachments

        1. PHOENIX-4733.patch
          2 kB
          Ankit Singhal

          Activity

            People

            • Assignee:
              ankit@apache.org Ankit Singhal
              Reporter:
              sjanardhan Srikanth Janardhan
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: