DDL Commands Details

alter     Alter column family schema;  pass table name and a dictionary
           specifying new column family schema. Dictionaries are described
           below in the GENERAL NOTES section.  Dictionary must include name
           of column family to alter.  For example,

           To change or add the 'f1' column family in table 't1' from defaults
           to instead keep a maximum of 5 cell VERSIONS, do:
           hbase> alter 't1', {NAME => 'f1', VERSIONS => 5}

           To delete the 'f1' column family in table 't1', do:
           hbase> alter 't1', {NAME => 'f1', METHOD => 'delete'}

           You can also change table-scope attributes like MAX_FILESIZE
           MEMSTORE_FLUSHSIZE and READONLY.

           For example, to change the max size of a family to 128MB, do:
           hbase> alter 't1', {METHOD => 'table_att', MAX_FILESIZE => '134217728'} 
create

ERROR: wrong number of arguments (0 for 1)

Here is some help for this command:
Create table; pass table name, a dictionary of specifications per
column family, and optionally a dictionary of table configuration.
Dictionaries are described below in the GENERAL NOTES section.
Examples:

  hbase> create 't1', {NAME => 'f1', VERSIONS => 5}
  hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'}
  hbase> # The above in shorthand would be the following:
  hbase> create 't1', 'f1', 'f2', 'f3'
  hbase> create 't1', {NAME => 'f1', VERSIONS => 1, TTL => 2592000, BLOCKCACHE => true}


I did this because i want to show how many parameters this shell command supports.
 
We will concentrate on creating two tables named "sample1" and "sample2".
"sample1" will be having default three versions and "sample2" will be having 10 versions.
create 'sample1','colfam'
This will create the table 'sample1',with default version 3 and column family name to be 'colfam'
create 'sample2',{NAME=>'colfam',VERSIONS=>10}
 
describe 
Describe the named table: e.g. "hbase> describe 't1'" 
 
disable 
Disable the named table: e.g. "hbase> disable 't1'" 
 
drop 
Drop the named table. Table must first be disabled. If table has more than one region, 
run a major compaction on .META.:
hbase> major_compact ".META."
 
enable 
Enable the named table

exists 
Does the named table exist? e.g. 
 
hbase> exists 't1'
Table log does exist 
 or
Table log does not exist
 
is_disabled 

is_disabled 't1'

True or False 


is_enabled 
is_enabled 't1'
 
True or false
 
list 
List all tables in hbase 
 
 

Comments

Popular posts from this blog

Configure FAIR Schedular in Spark

How to store a complex class object in hbase .......

Redis Quick Start Guide