Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get output from scans in hbase shell

Tags:

hbase

Is there any way I can output the results from a scan in the hbase shell to a file? I'm assuming this is easy but I haven't been able to find anything in the documentation.

like image 338
Dave Novelli Avatar asked Apr 05 '12 20:04

Dave Novelli


People also ask

What is the use of get () method in HBase?

You can retrieve data from the HBase table using the get() method of the HTable class. This method extracts a cell from a given row. It requires a Get class object as parameter.

How do I access HBase data?

To access HBase data sources, you must define a connection by using the properties in the Connection section on the Properties page. One instance of HBase connector is always linked with one table (for example, with a single connector instance you can read or write data to a single HBase table).

How do I get to HBase shell?

To access the HBase shell, you have to navigate to the HBase home folder. You can start the HBase interactive shell using “hbase shell” command as shown below. If you have successfully installed HBase in your system, then it gives you the HBase shell prompt as shown below.


1 Answers

I know that this post is quite old but i was searching something about HBase myself and came across with it.

Well i don't know if this is the best way to do it, but you can definitely use the scripting option HBase gives you. Just open a shell (preferably go to the directory bin of HBase) and run

echo "scan 'foo'" | ./hbase shell > myText 

where foo is the name of the table you want to scan. If you then open myText you will see the results in there. Hope i helped!

like image 144
Alex Karnezis Avatar answered Oct 02 '22 23:10

Alex Karnezis