Database Reference
In-Depth Information
and can be quite complex to master. You may want to investigate a tool such
as HBase Manager ( http://sourceforge.net/projects/hbasemanagergui/ ),
which provides a simple graphical user interface (GUI) to the HBase
database.
Loading and Querying HBase
To complete the exercise in this section, you need to download and install
the Hortonworks Data Platform (HDP) for Windows from Hortonworks.
(Note: At the time of this writing the HBase shell is not yet exposed in
HDP for Windows or HDInsight. It is anticipated it will be available in early
2014.) You can set up HDP for Windows on a development server to provide
a local test environment that supports a single-node deployment. (For a
detailed discussion of installing the Hadoop development environment on
Windows, see http://hortonworks.com/products/hdp-windows/ . )
In this exercise, you load stock data into an HBase table and query the
data using scan filters. The file containing the data is a tab-separated value
file named StocksTest.tsv that you can download from
http://www.wiley.com/go/microsoftbigdatasolutions.com . The first step is
toloadthefileintotheHadoopfilesystem.OpentheHadoopcommand-line
interface and issue the following command to copy the file (although your
paths may differ):
hadoop fs -copyFromLocal
C:\SampleData\StocksTest.tsv /user/test/
StockTest.tsv
Youcanverifythefilewasloadedbyissuingalistcommandforthedirectory
you placed it in:
hadoop fs -ls /user/test/
The next step is to create the table structure in HBase. Open the HBase shell
and enter the following command to create a table named stock_test with
three column families (info, price, and trade):
create 'stock_test', 'info','price','trade'
You can use Pig Latin to load the data into the HBase table. Open the
Pig command shell and load the TSV file using the PigStorage function.
Search WWH ::




Custom Search