《hbase学习》-07-HBase 更改表名

来源:互联网 发布:java写的桌面程序 编辑:程序博客网 时间:2024/06/11 00:09

HBase 更改表名

hbase中没有rename命令,所以更改表名比较复杂。重命名主要通过hbase的快照功能。

1.停止表继续插入
hbase shell>disable ‘tableName’

2。制作快照
hbase shell> snapshot ‘tableName’, ‘tableSnapshot’

3.克隆快照为新的名字
hbase shell> clone_snapshot ‘tableSnapshot’, ‘newTableName’

4.删除快照
hbase shell> delete_snapshot ‘tableSnapshot’

5.删除原来表
hbase shell> drop ‘tableName’