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 built-in functions


Hive provides many built-in functions to aid us in the processing and querying of data. Some of the functionalities provided by these functions include string manipulation, date manipulation, type conversion, conditional operators, mathematical functions, and many more.

Getting ready

This recipe assumes that the earlier recipe has been performed. Install Hive and follow the earlier recipe if you have not done already.

How to do it...

This section demonstrates how to use the parse_url Hive function to parse the content of a URL:

  1. Start Hive CLI by running the following command:

    $ hive
    
  2. Issue the following command to obtain the FILE portion of the small image associated with each book:

    hive> select isbn, parse_url(image_s, 'FILE') from books limit 10; 
    Total MapReduce jobs = 1
    …..
    OK
    0195153448  /images/P/0195153448.01.THUMBZZZ.jpg
    0002005018  /images/P/0002005018.01.THUMBZZZ.jpg
    0060973129  /images/P/0060973129.01.THUMBZZZ.jpg
    ……
    Time taken: 17.183 seconds, Fetched...