Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.94.7, 0.95.0
-
None
Description
Add a section "how to rename a table" in the doc book.
The current easy solution without adding extra code in 94/95 is to use snapshots
hbase shell> disable 'tableName' hbase shell> snapshot 'tableName', 'tableSnapshot' hbase shell> clone 'tableSnapshot', 'newTableName' hbase shell> delete_snapshot 'tableSnapshot'
void rename(HBaseAdmin admin, String oldTableName, String newTableName) { String snapshotName = randomName(); admin.snapshot(snapshotName, oldTableName); admin.cloneSnapshot(snapshotName, newTableName); admin.deleteSnapshot(snapshotName); admin.deleteTable(oldTableName) }