HBase Shell - 从现有Hbase表创建简化表

时间:2016-07-20 11:12:32

标签: shell command hbase hbase-shell

我想通过Hbase shell创建一个简化版的HBase表。例如: HBase表'测试'已经存在于HBase中,其中包含以下信息:

TableName: 'test'
ColumnFamily: 'f'
Columns: 'f:col1', 'f:col2', 'f:col3', 'f:col4'

我想在HBase' test_reduced'中创建另一个表。看起来像这样

TableName: 'test_reduced'
ColumnFamily: 'f'
Columns: 'f:col1', 'f:col3'

我们怎么能通过HBase shell做到这一点?我知道如何使用snapshot命令复制表所以我主要是在HBase Table中查找删除列名。

1 个答案:

答案 0 :(得分:0)

无法做到。您需要使用Hbase客户端API。

1-阅读表格。

2-只" put"你想要进入新表的列。

Cloudera让用户能够执行"部分HBase表副本"使用" CopyTable"函数,但这将允许你只更改column_family名称...(我不确定你是否使用cloudera),但即便如此,也不是你想要的。

你的参考: http://blog.cloudera.com/blog/2012/06/online-hbase-backups-with-copytable-2/

相关问题