0

I have one hbase table named Table1,has row T1,T2,T3,...Tn , the new table named Table2. How can I copy all data in (T1,T3,T5 ...) from Table1 to Table2 ? One by one to get the row, then put to the new table is so slow.

lanyun
  • 141
  • 1
  • 4
  • 10

1 Answers1

0

CopyTable is one utility which runs mapreduce to copy 2 tables and its much faster. However, it does not support selective copy (odd rows in your case. It only support timerange for portions of the hbase table. So, one option could be to run CopyTable first to copy all the data and then delete one by one. Another option could be to use Hive ,if you don't want to deal with Hbase tables and are more comfortable with SQL.
Example of CopyTable -
hbase org.apache.hadoop.hbase.mapreduce.CopyTable --new.name=sample_new sample_old
Here sample_old is table to be copied and sample_new is new table.

Chandra kant
  • 1,554
  • 1
  • 11
  • 14