In this recipe, you will learn how you can define tables using WebHCat
APIs.
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.
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'
Refer to the following URL for more information on WebHCat APIs:
https://cwiki.apache.org/confluence/display/Hive/WebHCat+Reference.