Debugging with HBase Shell (Common Commands)
HBase Shell is a feature of Hadoop HBase used to perform various operations quickly in HBase. Here are some commonly used HBase Shell commands.
Start HBase Shell
Start HBase Shell using a command
hbase shell
Basic Operations
List tables
list
list
Insert data
put
put 'table_name' 'column_family:column_name' 'value'
For example: put 'my_table' 'colf:cell1' '123'
Read data
get
get 'table_name' 'column_family:column_name'
For example: get 'my_table' 'colf:cell1'
Update data
update
update 'table_name' 'column_family:column_name' 'new_value'
For example: update 'my_table' 'colf:cell1' '456'
Delete data
delete
delete 'table_name' 'column_family:column_name'
For example: delete 'my_table' 'colf:cell1'
Table and Column Management
Get table list
list tables
list tables
Delete table
drop table
drop table 'table_name'
For example: drop table 'my_table'
Create table
create
create 'table_name' 'column_family:column_name' 'column_family:column_name'
For example: create 'my_table' 'colf:cell1' 'cols:cell2'
Other Operations
List current HBase users
users
users
Exit HBase Shell
exit
exit
The above are commonly used HBase Shell commands. Understanding these commands can help you debug and operate more efficiently.