Hadoop's--hbase shell command

Source: Internet
Author: User

Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/46463503

HBASE Shell

Enter HABSE database terminal: # $HBASE _home/bin/hbase Shell

Create a table

>create ' users ', ' user_id ', ' address ', ' info '

Table users, there are three column families User_id,address,info

List all Tables

>list

Get a description of the table

>describe ' Users

Create a table

>create ' users_tmp ', ' user_id ', ' address ', ' info '

Delete a table

>disable ' users_tmp '

>drop ' users_tmp '

Add a record

Put ' users ', ' xiaoming ', ' info:age ', ' 24 ';

Put ' users ', ' xiaoming ', ' info:birthday ', ' 1987-06-17 ';

Put ' users ', ' xiaoming ', ' info:company ', ' Alibaba ';

Put ' users ', ' xiaoming ', ' address:contry ', ' China ';

Put ' users ', ' xiaoming ', ' address:province ', ' Zhejiang ';

Put ' users ', ' xiaoming ', ' address:city ', ' Hangzhou ';

Put ' users ', ' Zhangyifei ', ' info:birthday ', ' 1987-4-17 ';

Put ' users ', ' Zhangyifei ', ' info:favorite ', ' movie ';

Put ' users ', ' Zhangyifei ', ' info:company ', ' Alibaba ';

Put ' users ', ' Zhangyifei ', ' address:contry ', ' China ';

Put ' users ', ' Zhangyifei ', ' address:province ', ' Guangdong ';

Put ' users ', ' Zhangyifei ', ' address:city ', ' Jieyang ';

Put ' users ', ' Zhangyifei ', ' address:town ', ' Xianqiao ';

Get a record 1. Get all data for an ID

>get ' users ', ' xiaoming '

2. Get an ID, all data for a column family

>get ' users ', ' xiaoming ', ' info '

3. Get an ID, all data for one column in a column family

Get ' users ', ' xiaoming ', ' info:age '

Update record

>put ' users ', ' xiaoming ', ' info:age ', ' 29 '

>get ' users ', ' xiaoming ', ' info:age '

>put ' users ', ' xiaoming ', ' info:age ', ' 30 '

>get ' users ', ' xiaoming ', ' info:age '

Get version data for cell data

>get ' users ', ' xiaoming ',{column=> ' info:age ', versions=>1}

>get ' users ', ' xiaoming ',{column=> ' info:age ', versions=>2}

>get ' users ', ' xiaoming ',{column=> ' info:age ', versions=>3}

Get a version of the cell data

〉get ' users ', ' xiaoming ',{column=> ' info:age ', timestamp=>1364874937056}

Full table Scan

>scan ' users '

Delete the ' info:age ' field of the Xiaoming value

>delete ' users ', ' xiaoming ', ' info:age '

>get ' users ', ' xiaoming '

Delete entire row

>deleteall ' users ', ' xiaoming '

Number of rows in the statistics table

>count ' users '

Clear table >truncate ' users '

Hadoop's--hbase shell command

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.