How to use the HBASE shell to create a table with preliminary splitting and compression or other parameters

In the HBase shell, the help file shows us that there are several valid syntaxes for creating the 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 create a table in which I specify both Split and some table parameters, such as COMPRESSION => 'SNAPPY' and VERSIONS, but I cannot understand the syntax or find useful documentation.

+8
hbase
source share
1 answer

What became clear after the experiments was that Shell syntax would accept a set of Column Family dictionaries, and the SPLIT dictionary would be its own animal (which makes sense because it modifies the entire table, not just a specific column family.

Thus, an additional useful example:

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

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

+13
source share

All Articles