首页 > 技术文章 > hbase常用命令

ngy0217 2018-12-02 17:52 原文

进入hbase命令行:任意目录

    hbase shell   

 

进入命令行后,hbase查看表:list

查看表中所有数据:scan 'table_name'

    如:scan 'dim_user_city'

 

创建表:

    create '表名','别名'

    create 'dim_user_firstcity','cx'

    create 'dim_user_city','cx'

    create 'dim_user_guid','cx'

    create 'user_credit_status','cx'

    

 

查询数据:

  get '表名','rowkey'

  如:ge 'dim_user_city','00321:420100'

 

插入数据:

    put '表名','rowkey','表别名:字段名',‘字段值’

    如:put 'dim_user_city','00321:420100','cx:count',1

 

清空表数据:

truncate  'user_credit_status'

推荐阅读