This tutorial describes how to fetch a single row and specific columns from the table using the HBase shell and will practice with some examples.
Reading Data From HBase Table using Get command
Use get
to retrieve the data from a single row and it’s columns. The syntax for command get is as follows.
Syntax: get ‘<namespace>:<table_name>’, ‘<row_key>’, ‘<column_key>’
Example:
Below command returns ‘2’ with all columns
![hbase read data from table using get command](https://i0.wp.com/sparkbyexamples.com/wp-content/uploads/2019/09/hbase-get-command-examples.png?fit=1024%2C129&ssl=1)
This again returns ‘2’ but with just columns specified ‘office:age’ and ‘office:name’
![hbase read data from table using get command](https://i0.wp.com/sparkbyexamples.com/wp-content/uploads/2019/09/hbase-get-command-examples-2.png?fit=1024%2C112&ssl=1)
Alternatively, this command returns the same result
![hbase read data from table using get command](https://i2.wp.com/sparkbyexamples.com/wp-content/uploads/2019/09/hbase-get-command-examples-3.png?fit=1024%2C112&ssl=1)
Other commands to explore
![hbase read data from table using get command](https://i2.wp.com/sparkbyexamples.com/wp-content/uploads/2019/09/hbase-get-command-other-examples.png?fit=1024%2C311&ssl=1)
Next, Let’s see how to enable or disable a table.