#在命名空间ns1下,创建表t1,其中有一个列族f1,f1的版本数为5
hbase> create 'ns1:t1', {NAME => 'f1', VERSIONS => 5}
#在默认命名空间下,创建表t1,有三个列族f1,f2,f3
hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'}
#等价于
hbase> create 't1', 'f1', 'f2', 'f3'
#创建表t1,列族f1,并设置f1的版本数为1,属性TTL为2592000,属性BLOCKCACHE为true。属性的含义在这就不解释了。
hbase> create 't1', {NAME => 'f1', VERSIONS => 1, TTL => 2592000, BLOCKCACHE => true}
# 创建表t1,列族f1,并设置f1的配置hbase.hstore.blockingStoreFiles 为 10
hbase> create 't1', {NAME => 'f1', CONFIGURATION => {'hbase.hstore.blockingStoreFiles' => '10'}}
#创建表时,配置信息可以放在最后,例如:
hbase> create 'ns1:t1', 'f1', SPLITS => ['10', '20', '30', '40']
hbase> create 't1', 'f1', SPLITS => ['10', '20', '30', '40']
hbase> create 't1', 'f1', SPLITS_FILE => 'splits.txt', OWNER => 'johndoe'
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}, METADATA => { 'mykey' => 'myvalue' }
hbase> # Optionally pre-split the table into NUMREGIONS, using
hbase> # SPLITALGO ("HexStringSplit", "UniformSplit" or classname)
#指定Pre-splitting的region的块数,和分割函数。
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit', REGION_REPLICATION => 2, CONFIGURATION => {'hbase.hregion.scan.loadColumnFamiliesOnDemand' => 'true'}}
#也可以用另一个表t2的引用去创建一个新表t1,t1表具有t2的所有列族,并且加上f1列族。
hbase> t1 = create 't2', 'f1'