Hbase Shell Data Operating instructions

Source: Internet
Author: User


Start, close HBase
./bin/start-hbase.sh
./bin/stop-hbase.sh


Query the HBase version. Its syntax is as follows:
HBase (main):010:0> version


Build table
Create ' <table name> ', ' <column family> '
Create ' emp ', ' personal data ', ' professional data '


List all tables: List


Table Space:
Create_namespace ' name '


With the put command, you can insert rows into a table. Its syntax is as follows:
Put ' <namespace:table name> ', ' row1 ', ' <colfamily:colname> ', ' <value> '
(Table space name is not required)

Put ' emp ', ' 1 ', ' personal data:name ', ' Raju '
Put ' emp ', ' 1 ', ' personal data:city ', ' Hyderabad '
Put ' emp ', ' 1 ', ' professional data:designation ', ' manager '
Put ' emp ', ' 1 ', ' professional data:salary ', ' 50000 '

Put ' emp ', ' 2 ', ' personal data:name ', ' Mike '
Put ' emp ', ' 2 ', ' personal data:city ', ' Nanjing '
Put ' emp ', ' 2 ', ' Professional data:designation ', ' CEO '
Put ' emp ', ' 2 ', ' Professional data:salary ', ' 99000 '


To query all the data in a table:
HBase (main):026:0> scan ' emp '
ROW Column+cell
1 column=personal data:city, timestamp=1510047547743, Value=hyderabad
1 column=personal data:name, timestamp=1510047519200, Value=raju
1 column=professional data:designation, timestamp=1510047567498, Value=manager
1 column=professional data:salary, timestamp=1510047577830, value=50000
2 column=personal data:city, timestamp=1510047806635, value=nanjing
2 column=personal data:name, timestamp=1510047795408, Value=mike
2 column=professional data:designation, timestamp=1510047812168, Value=ceo
2 column=professional data:salary, timestamp=1510047818080, value=99000
2 row (s) in 0.0240 seconds


Use the Get command to get a row of data. Its syntax is as follows:
Get ' <table name> ', ' row1 '
Get ' emp ', ' 1 '


Use the Get method to read the specified column:
Hbase>get ' table name ', ' rowID ', {column = ' column Family:column name '}
Get ' emp ', ' 2 ', {column=> ' personal data:name '}

Hbase Shell Data Operating instructions

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.