Book Image

Apache Hive Cookbook

Book Image

Apache Hive Cookbook

Overview of this book

Hive was developed by Facebook and later open sourced in Apache community. Hive provides SQL like interface to run queries on Big Data frameworks. Hive provides SQL like syntax also called as HiveQL that includes all SQL capabilities like analytical functions which are the need of the hour in today’s Big Data world. This book provides you easy installation steps with different types of metastores supported by Hive. This book has simple and easy to learn recipes for configuring Hive clients and services. You would also learn different Hive optimizations including Partitions and Bucketing. The book also covers the source code explanation of latest Hive version. Hive Query Language is being used by other frameworks including spark. Towards the end you will cover integration of Hive with these frameworks.
Table of Contents (19 chapters)
Apache Hive Cookbook
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

WebHCat


In this recipe, you will learn how you can define tables using WebHCat APIs.

Getting ready

WebHCat, formerly called Templeton, allows access to the HCatalog service using REST APIs. Unlike HCatalog, which executed the command directly, WebHCat keeps the Hive, PIG, and MapReduce jobs in queues. The jobs can then be monitored and stopped as needed. The client needs to specify a HDFS location where the output of the job is stored.

How to do it…

HCatlog resources can be accessed by REST APIs using the following URI format:

http://www.myserver.com/templeton/v1/resource.

In the preceding URL, www.myserver.com is the URL where your WebHCat is running and the resource is the HCatalog resource name.

The following is a CURL command to get all databases in Hive:

curl -s 'http://localhost:50111/templeton/v1/ddl/database?user.name=shrey'

See also…

Refer to the following URL for more information on WebHCat APIs:

https://cwiki.apache.org/confluence/display/Hive/WebHCat+Reference.