create

Definition

Creates a new table. Requires a table name and at least one column family specification. Optionally, you can define table-scope and configuration parameters. Each column specification can be a simple string containing a column family name, or a dictionary using a key/value syntax with curly-braces. In the second case specifying the NAME attribute is mandatory.

Usage

create '[<namespace_name>:]<table_name>',
       '<column_family>' | {NAME => '<column_family>'[,
                           <cf_attribute_name> => <cf_attribute_value>,...]
                           }[,...][,
       {<table_attribute_name> => <table_attribute_value>,[...]}][,
       CONFIGURATION => {'<conf_attribute_name>' => <conf_attribute_value>[,...]}]
Arguments
Parameter Description

namespace_name

A namespace name

table_name

A table name

column_family

A column family name

cf_attribute_name

A column family attribute name

cf_attribute_value

A value of the specified column family attribute

table_attribute_name

A table-scope attribute name

table_attribute_value

A value of the specified table-scope attribute

conf_attribute_name

A configuration attribute name

conf_attribute_value

A value of the specified configuration attribute

Examples

Creating a table in the default namespace without dictionaries

hbase(main):005:0> create 't1', 'cf1', 'cf2'
Created table t1
Took 1.2482 seconds
=> Hbase::Table - t1

Using a new namespace and dictionaries for column families defining

hbase(main):001:0> create 'ns1:t2', {NAME => 'cf1', TTL => 2592000}, {NAME => 'cf2', VERSIONS => 5}
Created table ns1:t2
Took 1.6133 seconds
=> Hbase::Table - ns1:t2

Defining table-scope parameters after column families specifications

hbase(main):019:0> create 't3', 'cf1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}
Created table t3
Took 1.2313 seconds
=> Hbase::Table - t3

Defining configuration options after column families specifications

hbase(main):016:0> create 't4', 'cf1', CONFIGURATION => {'hbase.hregion.scan.loadColumnFamiliesOnDemand' => 'true'}
Created table t4
Took 1.3492 seconds
=> Hbase::Table - t4
Found a mistake? Seleсt text and press Ctrl+Enter to report it