【问题标题】:HBase Shell - Create a reduced table from existing Hbase tableHBase Shell - 从现有 Hbase 表创建简化表
【发布时间】:2016-07-20 11:12:31
【问题描述】:

我想通过 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 表中寻找删除列名。

【问题讨论】:

    标签: shell command hbase hbase-shell


    【解决方案1】:

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

    1- 读入表格。

    2- 仅将您想要的列“放入”新表中。

    Cloudera 通过使用户能够使用“CopyTable”功能执行“部分 HBase 表副本”来接近,但这将允许您仅更改 column_family 名称......(我不确定您是否使用 cloudera),但即便如此, 不是你要找的。​​p>

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-04-28
      • 2016-03-25
      • 1970-01-01
      • 2021-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多