I want to use phoenix to insert data into Hbase like this:
INSERT INTO mytable (col1, col2) VALUES (?, ?) ON DUPLICATE KEY UPDATE col2 = col2 + ?
Is there any method to achieve this in phoenix?
I want to use phoenix to insert data into Hbase like this:
INSERT INTO mytable (col1, col2) VALUES (?, ?) ON DUPLICATE KEY UPDATE col2 = col2 + ?
Is there any method to achieve this in phoenix?
No. It's not yet available. See related JIRA for some initial discussion to support above usecase. https://issues.apache.org/jira/browse/PHOENIX-6
Just an update, the feature has been released with Phoenix 4.9, the syntax being:
UPSERT INTO mytable (col1, col2) VALUES (?, ?) ON DUPLICATE KEY UPDATE col2 = col2 + ?;
UPSERT INTO mytable (col1, col2) VALUES (?, ?) ON DUPLICATE KEY IGNORE;