Database Reference
In-Depth Information
Impala and HBase
HBase is a very popular nonrelational database on Hadoop that stores data in a
column-oriented store model. HBase also uses HDFS as its data storage layer and
MapReduce to process data. The key difference between Hive and HBase is that
HBase is a complete nonrelational database running on Hadoop, while Hive is a SQL-
like database that supports SQL statements to process data. As it is another kind of
database, HBase supports the concepts of databases, tables, and columns and uses
SQL statements to submit queries while processing the data in tables on HDFS.
Impala does not disappoint us and provides great flexibility to query data in HBase
tables. Impala tables process datafiles stored on HDFS—great for bulk loads and
full-table-scan queries; however, HBase can perform efficient data processing by per-
forming individual row or range lookups. Impala considers HBase a key-value store
in which the key is mapped to one column in the Impala table and value fields are
mapped to other columns.
Tip
While discussing HBase, internals are out of the scope of this topic. If you are
working on the HBase table with Impala, I would suggest reading the appropriate
HBase documentation or visiting the Apache HBase website for the latest docu-
mentation, http://hbase.apache.org/ .
Here are the steps to work with HBase and Impala together:
1. Use the Hive shell to create a Hive table using CREATE EXTERNAL TABLE
and specific keywords and map Hive tables with HBase tables. We are using
the Hive shell only because certain keywords used in SQL statements are not
supported in Impala.
2. Define the column corresponding to the HBase row key as a string with the
#string keyword or map it to the STRING column.
3. Once the preceding steps are done, the Hive metastore will be updated with
the required information and Impala can perform queries on these tables.
4. Make sure Impala users have read/write access for HBase tables. Using the
GRANT command in HBase shell can do this.
Search WWH ::




Custom Search