phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miles Spielberg <mi...@box.com>
Subject Atomic UPSERT on indexed tables
Date Sat, 02 Jun 2018 00:39:34 GMT
>From https://phoenix.apache.org/atomic_upsert.html:

Although global indexes on columns being atomically updated are supported,
> it’s not recommended as a potentially a separate RPC across the wire would
> be made while the row is under lock to maintain the secondary index.


But the parser on 4.13.1 doesn't seem to agree:

0: jdbc:phoenix:thin:url=http://192.168.99.10> CREATE TABLE T1 (A VARCHAR
PRIMARY KEY, B VARCHAR);

No rows affected (1.299 seconds)

0: jdbc:phoenix:thin:url=http://192.168.99.10> CREATE INDEX T1_B ON T1(B);

No rows affected (6.285 seconds)

0: jdbc:phoenix:thin:url=http://192.168.99.10> UPSERT INTO T1(A,B)
VALUES('hello', 'world') ON DUPLICATE KEY IGNORE;

Error: Error -1 (00000) : Error while executing SQL "UPSERT INTO T1(A,B)
VALUES('hello', 'world') ON DUPLICATE KEY IGNORE": Remote driver error:
RuntimeException: java.sql.SQLException: ERROR 1224 (42Z24): The ON
DUPLICATE KEY clause may not be used when a table has a global index.
tableName=T1 -> SQLException: ERROR 1224 (42Z24): The ON DUPLICATE KEY
clause may not be used when a table has a global index. tableName=T1
(state=00000,code=-1)

0: jdbc:phoenix:thin:url=http://192.168.99.10>

Am I doing something wrong here? Is the documentation inaccurate?


Miles Spielberg
Staff Software Engineer


O. 650.485.1102
900 Jefferson Ave
Redwood City, CA 94063

Mime
View raw message