sathish
sathish

Reputation: 65

Overwriting HBase id

What happens when I add duplicate entry to hbase table. Happened to see updated timestamp to the column. Is there any property in hbase that have options to avoid/allow overwriting while adding to the table?

Upvotes: 0

Views: 710

Answers (1)

Gopi Kolla
Gopi Kolla

Reputation: 974

HBase client uses PUT to perform insert and update of a row. Based on the key supplied, if row key doesn't exist it inserts and if it does exist it updates. HBase update means add another version to row with latest data and timestamp. Read (get) will get the data with latest timestamp by default unless a timestamp is specified. (PUT is idempotent method). so i don't think there is any property to avoid overwriting. Probably you can use a prePut co-processor to customize some behavior. check out HBase API documentation for more on co processor (Package org.apache.hadoop.hbase.coprocessor)

https://hbase.apache.org/apidocs/index.html

Upvotes: 3

Related Questions