首页  >  文章  >  数据库  >  初试Hbase

初试Hbase

WBOY
WBOY原创
2016-06-07 15:21:50965浏览

初试Hbase 1. 进入 shell hbase shell 2. 查看所有库 list 3. 查看表结构 describe userInfo DESCRIPTION ENABLED {NAME = userInfo, FAMILIES = [{NAME = m, DATA_BLOCK_ENCODING = NONE, BLOOMFILTER = NONE, true REPLICATION_SCOPE = 0, VERSIONS = 3, C

初试Hbase

 

1. 进入 shell 

     hbase shell 

2. 查看所有库 

     list 

3. 查看表结构 

     describe 'userInfo' 
DESCRIPTION                                                                                            ENABLED                                                
 {NAME => 'userInfo', FAMILIES => [{NAME => 'm', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE', true                                                   
  REPLICATION_SCOPE => '0', VERSIONS => '3', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => '21474                                                        
 83647', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY => 'false', ENCODE_ON_DISK =>                                                         
 'true', BLOCKCACHE => 'true'}]}     

 

4. 查询 

     scan 'userInfo' , {LIMIT => 20}  ## 必须大写 
     get 'userInfo' ,'10001949' 

hbase(main):005:0> get 'userInfo' ,'17335912' 
COLUMN                                   CELL                                                                                                                 
 m:fansNum                               timestamp=1368898063007, value=21                                                                                   
 m:followGroupNum                        timestamp=1368992878152, value=11                                                                                    
 m:followNum                             timestamp=1368813940821, value=28                                                                                    
 m:goodsNum                              timestamp=1369239409259, value=77                                                                                    
 m:groupNum                              timestamp=1368989899011, value=9                                                                                     
 m:heartNum                              timestamp=1369239220703, value=248                                                                                   
 m:ilikeNum                              timestamp=1369239409259, value=110                                                                                   
 m:imageNum                              timestamp=1369239409259, value=16                                                                                    
 m:relayNum                              timestamp=1369239409259, value=405                                                                                  
 m:replyNum                              timestamp=1369239409259, value=11 

 


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn