Created 07-03-2020 08:25 AM
I need to update an hbase table to update the row_keys to include a random prefix between 0 and 10. I was told the best way would be to do a mapreduce job which will be quicker but am unfamiliar with pig, hive etc.
So if I cannot update the rowkey itself then I would need to copy the data over to a new table and create the new key if it doesn't have a prefix. Could someone please assist with the best way to script this out?
hbase org.apache.hadoop.hbase.mapreduce.CopyTable \
-Dmapreduce.job.queuename=test \
--starttime=1591298402000 \
--peer.adr=hbase-development.local.net:2181:/hbase-unsecure \
--new.name=customers_dev:customers_prod_keys \
customers_prod:customers_prod_keys
So instead of starttime I would like to have records created before a time and those that do not have a prefix like this:
10_BestBuy_987654321
Target_123456
So find the second type and update like the first.
Created 07-03-2020 09:21 AM
@JoeSmo wrote:I need to update an hbase table to update the row_keys to include a random prefix between 0 and 10. I was told the best way would be to do a mapreduce job which will be quicker but am unfamiliar with pig, hive etc.
So if I cannot update the rowkey itself then I would need to copy the data over to a new table and create the new key if it doesn't have a prefix. Could someone please assist with the best way to script this out? MySubwayCard
hbase org.apache.hadoop.hbase.mapreduce.CopyTable \
-Dmapreduce.job.queuename=test \
--starttime=1591298402000 \
--peer.adr=hbase-development.local.net:2181:/hbase-unsecure \
--new.name=customers_dev:customers_prod_keys \
customers_prod:customers_prod_keys
So instead of starttime I would like to have records created before a time and those that do not have a prefix like this:
10_BestBuy_987654321
Target_123456
So find the second type and update like the first.
I think below steps helps you,
Created 07-03-2020 01:59 PM
Sounds like the best way to do this is in java - perhaps?
Created 05-14-2021 03:11 AM
it could be as far as I know