Search code examples
hbasehdfs

Rename Row-Key In Hbase


I have a table customer in production, Now I want to rename the rowkey from 'timestamp' to 'SSN timestamp'. How can i do the same? Is there any alter command for changing the existing row keys or is there any other way to do ?


Solution

  • Hbase data saved in hdfs. Since hdfs blocks cannot be updated, you cannot update cells in hbase. Update is one delete and one new insert. You can write a map reduce to scan, delete and insert all rows. After that, do a major compaction to clean marked rows for delete.