简体   繁体   中英

how to change (update) a hbase row key value from aaa to bbb for example?

how can I change a row key value in hbase this row key is made of some column in table and all the values doesn't come in same time. after update a value of a column i want to update the row key is it possible to do? for example i have c1 , c2 , c3 columns and my uniq value in each row is c1, c2 together and row key is c1.value concatenate c2.value. first insert fill c1 and row key is c1 next time fill c2 for existing row (c1) and row key must set c1c2 for c1 existing row

At Splice Machine (Open Source) we hit this problem with base table and index table updates in hbase. An "Update" is actually a delete and insert when a primary key or index key is modified (no way around that). In our system something like this...

create table foo (col1, col2, primary key(col1)); insert into foo values (1,2),(3,4);

update foo set col1 = col2;

We would delete the rows 1,3 and write the rows 2,4 inside a single transaction/buffer.

Hope this helps and good luck.

Here is a link to our community site in case you want to look at our code.

http://community.splicemachine.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM