HBase Need to export data from one cluster and import it to another with slight modification in row key

青春壹個敷衍的年華 提交于 2021-02-11 12:32:05

问题


I am trying to export data from HBase table 'mytable' which rowkey starts with 'abc'.

scan 'mytable', {ROWPREFIXFILTER => 'abc'}

The above exported data need to be imported into the another cluster by changing the rowkey prefix from 'abc' to 'def'

Old Data:

hbase(main):002:0> scan 'mytable', {ROWPREFIXFILTER => 'abc'}
ROW               COLUMN+CELL                                                                                                                                
abc-6535523   column=track:aid, timestamp=1339121507633, value=some stream/pojos

New Data: (In another cluster)

hbase(main):002:0> get 'mytable', 'def-6535523'
    ROW               COLUMN+CELL                                                                                                                                
    def-6535523   column=track:aid, timestamp=1339121507633, value=some stream/pojos

Only part of the row key needs to be modified. Other data needs to be as same.

Tried to use bin/hbase org.apache.hadoop.hbase.mapreduce.Export table_name file:///tmp/db_dump/

In the Export there is no provision to specify start row and end row.

But don't know how to import it with changed rowkey.

Also is there any inbuilt available in HBase/Hadoop to achie

Please help.

来源:https://stackoverflow.com/questions/62994001/hbase-need-to-export-data-from-one-cluster-and-import-it-to-another-with-slight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!