Apache Hive : WebHCat Reference DDL

DDL Command — POST ddl

Description

Performs an HCatalog DDL command. The command is executed immediately upon request. Responses are limited to 1 MB. For requests which may return longer results consider using the Hive resource as an alternative.

URL

http://www.myserver.com/templeton/ddl

Parameters

Name Description Required? Default
exec The HCatalog ddl string to execute Required None
group The user group to use when creating a table Optional None
permissions The permissions string to use when creating a table. The format is “rwxrw-r-x”. Optional None

The standard parameters are also supported.

Results

Name Description
stdout A string containing the result HCatalog sent to standard out (possibly empty).
stderr A string containing the result HCatalog sent to standard error (possibly empty).
exitcode The exitcode HCatalog returned.

Example

Curl Command

% curl -s -d 'exec=show tables;' \
       'http://localhost:50111/templeton/v1/ddl?user.name=ekoifman'

Version information

Prior to Hive 0.13.0, user.name was specified in POST requests as a form parameter: curl -d user.name=*<user>*.

In Hive 0.13.0 onward, user.name should be specified in the query string (as shown above): 'http://.../templeton/v1/ddl?user.name=*<name>*'. Specifying user.name as a form parameter is deprecated.

JSON Output

{
 "stdout": "important\_table
            my\_other\_table
            my\_table
            my\_table\_2
            pokes
            ",
 "stderr": "WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated...
            Hive history file=/tmp/ctdean/hive\_job\_log\_ctdean\_201111111258\_2117356679.txt
            OK
            Time taken: 1.202 seconds
            ",
 "exitcode": 0
}

JSON Output (error)

{
  "stdout": "",
  "stderr": "WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated...
            Hive history file=/tmp/ctdean/hive\_job\_log\_ctdean\_201204051246\_689834593.txt
            FAILED: Parse Error: line 1:5 Failed to recognize predicate 'tab'...

            ",
  "exitcode": 11
}

Navigation Links Previous: GET version/hadoop
Next: GET ddl/database

General: DDL ResourcesWebHCat ReferenceWebHCat ManualHCatalog ManualHive Wiki HomeHive Project Site