Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Basic commands commonly used in Hbase

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "basic commands commonly used in Hbase". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the basic commands commonly used in Hbase.

Hbase table structure

1. Enter Hbase shell

>. / bin/hbase shell

two。 View the current operation user

> whoami

3. Create a table

/ / Table name column family 1 column family 2 > create 'Rumenz','user','userInfo'

4. View the tables in the database

> list

5. Add data

/ / Table name rowkey column family: field name value > put 'Rumenz','001','user:name',' entry site' > put 'Rumenz','001','user:type','1'

6. Query the number of record rows

> count 'Rumenz'

7. Query records through Row key

/ / Table name Row key > get 'Rumenz','001'

8. Query data through Row key and column families

/ / Table name Row key column family > get 'Rumenz','001','user'

9. Query all records in the table

/ / Table name > scan 'Rumenz'

10. View only one column of data

> scan 'Rumenz', {COLUMN= >' user:name'}

11. View only the data of a column of families

> scan 'Rumenz', {COLUMN= >' user'}

twelve。 Paging query

/ / STARTROW starts the line, LIMIT= > 1 takes a piece of data, and VERSIONS=1 queries the latest version > scan 'Rumenz', {STARTROW= >' 001 synchronization LIMIT1}.

13. Delete a column value from a column

/ / user:name is the field name > delete 'Rumenz','001','user:name'

14. Delete the value of a row (via Row key)

/ / 001 is Row key > deleteall 'Rumenz','001'

Update data

> put 'Rumenz','002','user:name',' New value'

16. Add column families

> alter 'Rumenz','depart'

17. Delete column Family

> alter 'Rumenz','delete'= >' depart'

18. Column families cannot be renamed (you can create a new column family, copy the value, and then delete the old column family)

19. Table rename

There is no rename operation / / 1 in the table in / / Hbase. Disable table insertion > disable 'Rumenz'//2. Make a snapshot > snapshot 'Rumenz','RumenzShot'//3. The clone snapshot is the new name > clone_snapshot 'RumenzShot','RumenzNew'//4. Delete snapshot > delete_snapshot 'RumenzShot'//5. Delete the original table > drop 'Rumenz'

20. Delete tabl

/ / 1. Disable table insertion > disable 'RumenzNew' > drop' RumenzNew'

21. Check whether a table exists

> exists' RumenzNew'

twenty-two。 View table structure

> desc 'RumenzNew' at this point, I believe you have a deeper understanding of "basic commands commonly used in Hbase". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report