phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samarth Jain (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-2765) PhoenixConnection commit throws ArrayIndexOutOfBoundsException after upserting multiple rows with dynamic columns
Date Tue, 15 Mar 2016 23:46:33 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-2765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15196493#comment-15196493
] 

Samarth Jain commented on PHOENIX-2765:
---------------------------------------

[~cker@salesforce.com] - just to be sure, are you seeing this error with 4.6 or 4.7 version
of phoenix. Looking at the "affects version" on this JIRA I am implying you are running into
this problem on 4.6. Can you try with 4.7? 

> PhoenixConnection commit throws ArrayIndexOutOfBoundsException after upserting multiple
rows with dynamic columns
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-2765
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2765
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.6.0
>            Reporter: Clifford Ker
>            Assignee: Thomas D'Silva
>
> 1. Create a Phoenix table with dynamic columns.
> 2. Obtain a PhoenixConnection and PreparedStatement.
> 3. Use the PreparedStatement to upsert multiple records using dynamic columns.
> 4. Commit the transaction.
> 5. Phoenix will throw ArrayIndexOutOfBoundException.
> java.lang.ArrayIndexOutOfBoundsException: 14
>     at org.apache.phoenix.execute.MutationState.validate(MutationState.java:384)
>     at org.apache.phoenix.execute.MutationState.commit(MutationState.java:419)
>     at org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:476)
>     at org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:473)
>     at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
>     at org.apache.phoenix.jdbc.PhoenixConnection.commit(PhoenixConnection.java:473)
>     at phoenix.connection.ProtectedPhoenixConnection.commit(ProtectedPhoenixConnection.java:41
> Pseudo Code and DML
> CREATE TABLE IF NOT EXISTS FOO_RECORD
>     (
>     KEY1 char(15) not null,
>     KEY2 char(15) not null,
>     KEY3 SMALLINT not null,
>     STATUS TINYINT not null,	
>     KEY4 varchar(30),	
>     KEY5 char(15) not null,	
>     FOO_RECORD_ID char(15),	
>     SYSMODSTAMP TIMESTAMP,	
>     "av"."_" char(1),                       	-- Column family av
>     "rv"."_" char(1),				-- Column family rv
>     "fd"."_" char(1),                       	-- Column family dv
>     CONSTRAINT PK PRIMARY KEY (
>     	KEY1,
>     	KEY2,
>     	KEY3,
>     	STATUS,
>     	KEY4,
>         KEY5
>     )
> ) VERSIONS=1,MULTI_TENANT=true,REPLICATION_SCOPE=1
> try {
>                 PreparedStatement preparedStmt = phoenixConnection.prepareStatement(upsertStatement);
>                 for (DARecord record : daRecords) {
>                     prepareToUpserFooRecord(preparedStmt, fieldInfo, record);
>                 }
>                 preparedStmt.close();
>                 phoenixConnection.commit();
>             } finally {
>                 phoenixConnection.close();
>             }
> UPSERT INTO FOO_RECORD(
> KEY1, KEY2, KEY3, STATUS, KEY4, KEY5, SYSMODSTAMP, "fa"."FIELD1" VARCHAR, "av"."FIELD2"
VARCHAR, "av"."FIELD3" VARCHAR, "av"."FIELD4" VARCHAR, "rv"."FIELD1" VARCHAR, "rv"."FIELD2"
VARCHAR, "rv"."FIELD3" VARCHAR, "rv"."FIELD4" VARCHAR, "rv"."FIELD5" VARCHAR, "rv"."FIELD6"
VARCHAR, "rv"."FIELD7" VARCHAR, "rv"."FIELD8" VARCHAR, "rv"."FIELD9" VARCHAR, "rv"."FIELD10"
VARCHAR, "rv"."FIELD11" VARCHAR, "rv"."FIELD12" VARCHAR, "rv"."FIELD13" VARCHAR, "rv"."FIELD14"
VARCHAR, "rv"."FIELD15" VARCHAR, "fd"."FIELD1" TINYINT, "fd"."FIELD2" TINYINT, "fd"."FIELD3"
TINYINT, "fd"."FIELD4" TINYINT, "fd"."FIELD5" TINYINT, "fd"."FIELD6" TINYINT, "fd"."FIELD7"
TINYINT, "fd"."FIELD8" TINYINT, "fd"."FIELD9" TINYINT, "fd"."FIELD10" TINYINT, "fd"."FIELD11"
TINYINT, "fd"."FIELD12" TINYINT, "fd"."FIELD13" TINYINT, "fd"."FIELD13" TINYINT, "fd"."FIELD15"
TINYINT) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message