I have a Hbase table X and I want to create an exact copy of it and name it Y. Could someone let me know how it is possible?
Thanks
If your both cluster hbase versions are different then you can use Copytable method. Done your table will be copied. In this if we copy the Hfiles manually from one Hbase cluster to another, in that case list command dispalys all the tables, But scanning a table does not shown any data.
To move the data from one HBase cluster to another, use snapshot and either the clone_snapshot or ExportSnapshot utility; or, use the CopyTable utility. To move the data from one HBase cluster to another without downtime on either cluster, use replication.
The add() method of Put class is used to insert data. It requires 3 byte arrays representing column family, column qualifier (column name), and the value to be inserted, respectively. Insert data into the HBase table using the add() method as shown below.
Assuming you want to copy the table on the same cluster you can use HBase snapshots in the hbase shell
you can
snapshot 'sourceTable', 'sourceTable-snapshot' clone_snapshot 'sourceTable-snapshot', 'newTable'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With