Hi NaHeon Kim,

Please refer to mailing list: 
https://lists.apache.org/thread.html/fb747661f535b0a407bf38e6b961a2c68634815189c80a7d612366b1@%3Cuser.phoenix.apache.org%3E


I also faced similar issue.


Regards,
Dhaval Modi
dhavalmodi24@gmail.com

On 26 February 2017 at 10:34, NaHeon Kim <honey.and.sw@gmail.com> wrote:
Hi all,

UPSERT into a table with ROW_TIMESTAMP column is not possible.
I'm using phoenix-4.8.0-hbase-1.1.

Table Schema:

create table my_table (
   obj_id varchar(20) not null,
   create_dt timestamp not null,
   keyword varchar(100) not null,
   count integer
   constraint pk primary key (obj_id, create_dt row_timestamp, keyword)
);



1) Spark Integration
No rows are inserted. No errors.

2) sqlline.py - timestamp column is in a query
No rows are inserted.

        upsert into my_table (obj_id, create_dt, keyword, count)
        values ('objid', '2017-02-26 13:48:00', 'k', 100);

3) sqlline.py - timestamp column is not in a query
This throws an exception:
java.lang.ArrayIndexOutOfBoundsException: 8
at org.apache.phoenix.execute.MutationState.getNewRowKeyWithRowTimestamp(MutationState.java:548)
at org.apache.phoenix.execute.MutationState.generateMutations(MutationState.java:627)
at org.apache.phoenix.execute.MutationState.addRowMutations(MutationState.java:566)
at org.apache.phoenix.execute.MutationState.send(MutationState.java:908)
at org.apache.phoenix.execute.MutationState.send(MutationState.java:1329)
at org.apache.phoenix.execute.MutationState.commit(MutationState.java:1161)
at org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:529)

        upsert into my_table (obj_id, keyword, count)
        values ('objid', 'k', 100);

Everything works well without row_timestamp.
Thanks in advance! : )