Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: rename page RESTAPI to avoid redundancy

Overview: HCatalog REST API

Table of Contents
Info
titleVersion information

The HCatalog project graduated from the Apache incubator and merged with the Hive project on March 26, 2013.
Hive version 0.11.0 is the first release that includes HCatalog and its REST API, WebHCat.

Introduction to WebHCat

This document describes the HCatalog REST API, WebHCat, which was previously called Templeton.

...

Info
titleWebHCat or Templeton?

For backward compatibility, the original name Templeton is still used for WebHCat in some contexts. See #Project Name below.

URL format

HCatalog's REST resources are accessed using the following URL format:

...

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

Security

The current version supports two types of security:

  • Default security (without additional authentication)
  • Authentication via Kerberos

Standard Parameters

Every REST resource can accept the following parameters to aid in authentication:

  • user.name: The user name as a string. Only valid when using default security.
  • SPNEGO credentials: When running with Kerberos authentication.

Specifying user.name

The user.name parameter is part of POST parameters for POST calls, and part of the URL for other calls.

...

No Format
% curl -s -d user.name=ctdean \
       -d rename=test_table_2 \
       'http://localhost:50111/templeton/v1/ddl/database/default/table/test_table'

Security Error Response

If the user.name parameter is not supplied when required, the following error will be returned:

No Format
{
  "error": "No user found.  Missing user.name parameter."
}

WebHDFS and Code Push

Data and code that are used by HCatalog's REST resources must first be placed in Hadoop. When placing files into HDFS is required you can use whatever method is most convienient for you. We suggest WebHDFS since it provides a REST interface for moving files into and out of HDFS.

Error Codes and Responses

The server returns the following HTTP status codes.

...

Other data returned directly by the server is returned in JSON format. JSON responses are limited to 1MB in size. Responses over this limit must be stored into HDFS using provided options instead of being directly returned. If an HCatalog DDL command might return results greater than 1MB, it's suggested that a corresponding Hive request be executed instead.

Log Files

The server creates three log files when in operation:

...

In the tempelton-log4j.properties file you can set the location of these logs using the variable templeton.log.dir. This log4j.properties file is set in the server startup script.

Project Name

The original work to add REST APIs to HCatalog was called Templeton. For backward compatibility the name still appears in URLs, log file names, etc. The Templeton name is taken from a character in the award-winning children's novel Charlotte's Web, by E. B. White. The novel's protagonist is a pig named Wilbur. Templeton is a rat who helps Wilbur by running errands and making deliveries as requested by Charlotte while spinning her web.

...