Book Image

Hadoop MapReduce v2 Cookbook - Second Edition: RAW

Book Image

Hadoop MapReduce v2 Cookbook - Second Edition: RAW

Overview of this book

Table of Contents (19 chapters)
Hadoop MapReduce v2 Cookbook Second Edition
Credits
About the Author
Acknowledgments
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using Hive to insert data into HBase tables


Hive-HBase integration gives us the ability to query HBase tables using the Hive Query Language (HQL). Hive-HBase integration supports mapping of existing HBase tables to Hive tables as well as the creation of new HBase tables using HQL. Both reading data from HBase tables and inserting data into HBase tables are supported through HQL, including performing joins between Hive-mapped HBase tables and traditional Hive tables.

The following recipe uses HQL to create an HBase table to store the books table of the bookcrossing dataset and populate that table using sample data.

Getting ready

Follow the Hive batch mode - using a query file recipe of Chapter 6, Hadoop Ecosystem – Apache Hive to create the Hive table that we'll be using in this recipe.

How to do it...

This section demonstrates how to access a Hive table from Pig. Proceed with the following steps:

  1. Start the Hive shell with the following command:

    $ hive
    
  2. Issue the following command in the Hive shell...