Lab 7
Objec ve :- to perform hbase DDL and DML Commands.
1 hbase shell
2 list: Lists all the table in Hbase
3. version: provide the version of Hbase being used
4 table help: Provides help for table -referece commands
Ayushi Chaubey 202210101140021 Big Data Analy cs
DDL Commands:
1Create Table:
Syntax: create '<table_name>', '<column_family1>', '<column_family2>', ...
Example:create 'my_table', 'cf1', 'cf2';
2 Describe Table:
Syntax:Describe ‘<table name>’
Example: describe ‘mytable’;
3 Alter Table:
Syntax: alter ‘<table name>’,{NAME=> ‘<new_column_family>’}
Example: alter ‘my_table’,{NAME=’cf3’}
Ayushi Chaubey 202210101140021 Big Data Analy cs
4 Disable and Enable Table:
disable '<table_name>'
enable '<table_name>'
5 Drop Table:
Drop ‘<table_name>’
6 Scan Table:
Scan ‘<table name>’
7. get data: to get data from specific row
Syntax: get ‘<table name>’, ‘<row key>’;
Example: get ‘mytable’, ‘row1’;
8. put data: to insert or update data into a table
Syntax: put ‘<table name>’, ‘row_key’, ‘<column_family: column_qualifier>’, ‘<value>’
Example: put ‘mytable’, ‘row1’, ‘cf1:column1’, ‘value1’;
9 Delete Data: To delete data from a table:
syntax: delete '<table_name>', '<row_key>', '<column_family:column_qualifier>'
Example: delete 'my_table', 'row1', 'cf1:column1'
Ayushi Chaubey 202210101140021 Big Data Analy cs
10 Exit Hbase Shell:
To exit the Hbase shell
Syntax: exit
Ayushi Chaubey 202210101140021 Big Data Analy cs