我如何使用HBASE Shell创建预分割和压缩或其他选项的表格 [英] How can I use the HBASE Shell to create a table with pre splitting and compression or other options

查看:483
本文介绍了我如何使用HBASE Shell创建预分割和压缩或其他选项的表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在HBase shell中,帮助文件告诉我们有几种允许的语法来创建表:

  create' tableName',{NAME => 'colFamily',版本=> 5} 
创建'tableName',{NAME => 'cf1'},{NAME => 'cf2'}
创建'tableName','cf1','cf2','cf3'
创建'tableName','cf1',{SPLITS => ['10','20','30','40']}

我想创建一个表,在其中指定Split和一些表选项,如COMPRESSION =>'SNAPPY'和VERSIONS,但我似乎无法弄清楚语法或找到有用的文档。


<在实验之后最终变得清晰的是,Shell语法将接受一系列Column Family字典,而SPLIT字典实际上是它自己的动物(这是有道理的它修改了整个表格,而不仅仅是一个特定的列族。



因此,另一个有用的示例是:

  create'tableName',{NAME =>'colFam',VERSIONS => 2,COMPRESSION =>'SNAPPY'},
{SPLITS => ['333','666','FOO']}

请注意,split字典是分开的从列家字典中;大概我们仍然可以输入一组列然后以Splits字典结尾。


In the HBase shell, the help file shows us that there are several allowable syntaxes for creating a table:

 create 'tableName', {NAME => 'colFamily', VERSIONS => 5 }
 create 'tableName', {NAME => 'cf1'}, {NAME => 'cf2'}
 create 'tableName', 'cf1', 'cf2', 'cf3'
 create 'tableName', 'cf1', {SPLITS => ['10','20','30','40']}

I want to make a table where I specify both a Split and a some table options, like COMPRESSION => 'SNAPPY' and VERSIONS, but I can't seem to figure out the syntax or find useful documentation.

解决方案

What eventually became clear after experimentation was that the Shell syntax will accept a set of Column Family dictionaries, and the SPLIT dictionary is really its own animal (which makes sense as it modifies the whole table, not just a particular column family.

So an additional useful example to have would be:

 create 'tableName', {NAME => 'colFam', VERSIONS => 2, COMPRESSION => 'SNAPPY'}, 
    {SPLITS => ['333','666','FOO']}

Note that the splits dictionary is separate from the column family dictionary; presumably we could still enter a set of column families and then end with the Splits dictionary.

这篇关于我如何使用HBASE Shell创建预分割和压缩或其他选项的表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆