O'Reilly logo

Hadoop MapReduce v2 Cookbook - Second Edition by Thilina Gunarathne

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hive batch mode - using a query file

In addition to the Hive interactive CLI, Hive also allows us to execute our queries in the batch mode, using a script file. In this recipe, we use a Hive script file to create books, users, and ratings tables of the Book-Crossing dataset and to load the data into the newly created tables.

How to do it...

This section demonstrates how to create tables and load data using a Hive script file. Proceed with the following steps:

  1. Extract the data package provided in the source repository of this chapter:
    $ tar –zxvf chapter6-bookcrossing-data.tar.gz
    
  2. Locate the create-book-crossing.hql Hive query file in the Hive-scripts folder of the source repository for this chapter. Execute this Hive script file as follows by providing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required