0

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?

General Failure
  • 2,421
  • 4
  • 23
  • 49
cxco
  • 143
  • 2
  • 13

2 Answers2

0

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

Ankit Singhal
  • 834
  • 7
  • 8
0

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;
Juvenn Woo
  • 807
  • 6
  • 10