You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Alex Field (JIRA)" <ji...@apache.org> on 2017/11/10 21:30:00 UTC

[jira] [Created] (PHOENIX-4369) ArrayIndexOutOfBounds when upserting to table using ROW_TIMESTAMP

Alex Field created PHOENIX-4369:
-----------------------------------

             Summary: ArrayIndexOutOfBounds when upserting to table using ROW_TIMESTAMP
                 Key: PHOENIX-4369
                 URL: https://issues.apache.org/jira/browse/PHOENIX-4369
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.10.0
         Environment: Ubuntu 16.04, JRE 1.8.0_102_x64
            Reporter: Alex Field



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();
        }
    }




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)