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

ArrayIndexOutOfBounds when upserting to table using ROW_TIMESTAMP

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 4.10.0
    • None
    • None
    • Ubuntu 16.04, JRE 1.8.0_102_x64

    Description

      Used this DDL to create a table which uses ROW_TIMESTAMP

      CREATE TABLE IF NOT EXISTS FOO (
      TENANT_ID CHAR(15) NOT NULL,
      PK_BAR VARCHAR(80) NOT NULL, – NAME
      PK_ROW_TIMESTAMP TIMESTAMP NOT NULL,
      FIZZ TIMESTAMP,
      BUZZ VARCHAR(255), – LABEL
      BAZZ CHAR(15), – VERSION_ID
      QUX INTEGER,
      HODOR VARCHAR(100000) – A json blob.
      CONSTRAINT PK PRIMARY KEY (TENANT_ID, PK_BAR, PK_ROW_TIMESTAMP ROW_TIMESTAMP)
      ) VERSIONS=3,MULTI_TENANT=true,REPLICATION_SCOPE=1

      Upsert causes this exception:

      java.lang.ArrayIndexOutOfBoundsException: 8
      at org.apache.phoenix.execute.MutationState.getNewRowKeyWithRowTimestamp(MutationState.java:554)
      at org.apache.phoenix.execute.MutationState.generateMutations(MutationState.java:640)
      at org.apache.phoenix.execute.MutationState.addRowMutations(MutationState.java:572)
      at org.apache.phoenix.execute.MutationState.send(MutationState.java:1003)
      at org.apache.phoenix.execute.MutationState.send(MutationState.java:1469)
      at org.apache.phoenix.execute.MutationState.commit(MutationState.java:1301)
      at org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:533)
      at org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:530)
      at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
      at org.apache.phoenix.jdbc.PhoenixConnection.commit(PhoenixConnection.java:530)

      Here's a copy of the test driver:

      @Test
      public void testSomething() throws Exception {
      String sql = "UPSERT INTO FOO (BUZZ, BAZZ, PK_BAR) VALUES (?, ?, ?)";
      try (PreparedStatement stmt = conn.prepareStatement(sql))

      { stmt.setString(1, "blah blah"); stmt.setString(2, null); stmt.setString(3, "blah"); stmt.execute(); conn.commit(); }

      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              afield Alex Field
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: