HBase Shell Basic Commands

Source: Internet
Author: User

1. Enter HBase Shell

[Email protected]:~/hbase-0.98.8-hadoop1/conf$ hbase Shell
HBase Shell; Enter ' help<return> ' for list of supported commands.
Type "exit<return>" to leave the HBase Shell
Version 0.98.8-hadoop1, R6cfc8d064754251365e070a10a82eb169956d5fe, Fri Nov 17:14:19 PST 2014
HBase (Main):001:0>


HBase is not suitable for complex queries


2. The following are the operations

HBase (main):007:0> create ' user ', ' age ', ' name ', ' gender ', ' address '
0 row (s) in 0.7400 seconds
= Hbase::table-user



HBase (main):008:0> list
TABLE
Uesr
User
2 row (s) in 0.0080 seconds


HBase (main):009:0> describe ' user '
Table User is ENABLED
COLUMN Families DESCRIPTION
{NAME = ' address ', data_block_encoding = ' NONE ', bloomfilter = ' ROW ', Replication_scope = ' 0 ', VERSIONS =& Gt ' 1 ', Compressi
on = ' NONE ', min_versions = ' 0 ', TTL = ' FOREVER ', keep_deleted_cells = ' FALSE ', BLOCKSIZE = ' 65536 ', I N_memory = ' false
', Blockcache = ' true '}
{NAME = ' age ', data_block_encoding = ' NONE ', bloomfilter = ' ROW ', Replication_scope = ' 0 ', VERSIONS = ' 1 ', COMPRESSION =
> ' NONE ', min_versions = ' 0 ', TTL = ' FOREVER ', keep_deleted_cells = ' FALSE ', BLOCKSIZE = ' 65536 ', In_me Mory = ' false ', B
Lockcache = ' true '}
{NAME = ' gender ', data_block_encoding = ' NONE ', bloomfilter = ' ROW ', Replication_scope = ' 0 ', VERSIONS =&G T ' 1 ', COMPRESSIO
N = ' NONE ', min_versions = ' 0 ', TTL = ' FOREVER ', keep_deleted_cells = ' FALSE ', BLOCKSIZE = ' 65536 ', in _memory = ' false '
, Blockcache = ' true '}
{name = ' name ', data_block_encoding = ' NONE ', bloomfilter = ' ROW ', Replication_scope = ' 0 ', VERSIONS = ' 1 ', COMPRESSION
= ' NONE ', min_versions = ' 0 ', TTL = ' FOREVER ', keep_deleted_cells = ' FALSE ', BLOCKSIZE = ' 65536 ', in_m EMORY = ' false ',
Blockcache = ' true '}
4 row (s) in 0.0580 seconds



You must first disable the table before deleting the table

HBase (Main):010:0> disable ' UESR '
0 row (s) in 1.3560 seconds

HBase (Main):012:0> drop ' uesr '
0 row (s) in 0.2450 seconds

HBase (main):013:0> list
TABLE
User
1 row (s) in 0.0080 seconds



New data (' Table name ', ' Row key ', ' column family: Column ', ' value ')

HBase (main):016:0*> put ' user ', ' xiaoming ', ' address:city ', ' newyork '
0 row (s) in 0.0250 seconds


Querying data (' Table name ', ' Row key ')

HBase (main):002:0> get ' user ', ' xiaoming '
COLUMN CELL
Address:city timestamp=1417013862751, Value=newyork
Age:real timestamp=1417273133703, value=14


HBase (main):003:0> get ' user ', ' xiaoming ', ' address '
COLUMN CELL
Address:city timestamp=1417013862751, Value=newyork


HBase (main):003:0> get ' user ', ' xiaoming ', ' address:city '
COLUMN CELL
Address:city timestamp=1417013862751, Value=newyork






HBase (main):011:0> scan ' user '
ROW Column+cell
Xiaoming column=address:city, timestamp=1417013862751, value=newyork
Xiaoming column=age:real, timestamp=1417273547325, value=16









HBase Shell Basic Commands

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.