HBase Shell Common Commands

Source: Internet
Author: User
Tags ming

    • Quick start from official Hbase

HBase (main):003:0> create ' test ', ' CF ' 0 row (s) in 1.2200 secondshbase (main):003:0> list ' test ': 1 row (s) in 0.0550 secondshbase (main):004:0> put ' test ', ' row1 ', ' cf:a ', ' value1 ' 0 row (s) in 0.0560 secondshbase (main): 005:0> put ' test ', ' row2 ', ' cf:b ', ' value2 ' 0 row (s) in 0.0370 secondshbase (main):006:0> put ' test ', ' row3 ', ' cf:c ', ' Value3 ' 0 row (s) in 0.0450 seconds

Another common command is,
HBase (Main):006:0> truncate ' test '
(Note: ' Truncate ' functions like MySQL, emptying the data of the table. Use with caution! )

HBase (main):006:0> describe ' test '
(Note: Query the column family of the test table)
HBase (Main):006:0> count ' test '
(Note: Count the number of records in the ' Test ' table)
HBase (main):006:0> get ' test ', ' row1 '
(Note: Get a record)
HBase (main):006:0> scan ' test '
(Note: Query full table)
HBase (main):006:0> delete ' test ', ' cf:a '
(Note: Delete test table so record a column, you need to be careful!) )
HBase (Main):006:0> deleteall ' test ', ' row1 '
(Note: Delete the entire record of the test table, including any column of the Row1 single record)
    • Demos

The way to convert a relational people table to HBase Columnstore is as follows

People table Sex Age Summary Story
Zhangsan M 19 Summary for Zhangsan The story of Zhang San
Wangming F 20 Summary for Wangming Wang Ming, Song of Ming

Id Column Value Timestamp
p| Zhangsan Property:sex M XX (System time)
p| Zhangsan Property:age 19 Xx
p| Zhangsan Detail:summary Summary for Zhangsan Xx
p| Zhangsan Detail:story The story of Zhang San Xx
p| Wangming Property:sex F Xx
p| Wangming Property:age 20 Xx
p| Wangming Detail:summary Summary for Wangming Xx
p| Wangming Detail:story Wang Ming, Song of Ming Xx

Specific conversions such as:

HBase Shell Common Commands

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.