hbase shell-ddl(表定义指令)

hbase表定义指令详细解说篇

  1. alter, alter_async, alter_status

 

  2. create

  3. describe (可以简写成'desc')  显示某张表的结构情况

hbase(main):026:0> help 'describe'
1 Describe the named table. For example:
2   hbase> describe 't1'
3   hbase> describe 'ns1:t1'
4 
5 Alternatively, you can use the abbreviated 'desc' for the same thing.
6   hbase> desc 't1'
7   hbase> desc 'ns1:t1'
View Code
1 hbase(main):029:0> desc 'noc'
2 Table noc is ENABLED                                                                      
3 noc                                                                                     
4 COLUMN FAMILIES DESCRIPTION                                                               
5 {NAME => 'c', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOC
6 K_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'SNAPPY', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSI
7 ZE => '65536', REPLICATION_SCOPE => '1'}                                                                           
8 1 row(s) in 0.0900 seconds

  4. disable, disable_all, is_disabled

  5. drop, drop_all

  6. enable, enable_all, is_enabled

  7. exists

  8. get_table

  9. list  (列出所有的table,可以通过模式匹配进行过滤,注意进行模式匹配的地方使用'.*')

hbase(main):030:0> help 'list'
1 List all tables in hbase. Optional regular expression parameter could
2 be used to filter the output. Examples:
3 
4   hbase> list
5   hbase> list 'abc.*'
6   hbase> list 'ns:abc.*'
7   hbase> list 'ns:.*'
View Code
 1 hbase(main):031:0> list                #显示所有的table
 2 TABLE                                                                                                              
 3 cdr                                                                                                                
 4 noc                                                                                                                
 5 2 row(s) in 0.0070 seconds
 6 
 7 => ["cdr", "noc"]
 8 hbase(main):032:0> list 'c.*'          #显示以c开头的table
 9 TABLE                                                                                                              
10 cdr                                                                                                                
11 1 row(s) in 0.0020 seconds
12 
13 => ["cdr"]
14 hbase(main):033:0> list 'c*'          #这样做得不到想要的结果
15 TABLE                                                                                                              
16 0 row(s) in 0.0010 seconds
17 
18 => []
19 hbase(main):034:0> list 'default:.*'      #显示namespace为default的table
20 TABLE                                                                                                              
21 cdr                                                                                                                
22 noc                                                                                                                
23 2 row(s) in 0.0010 seconds

  10. locate_region

  11. show_filters

正在编辑中

posted @ 2017-02-07 15:25  时光舟  阅读(892)  评论(0编辑  收藏  举报