...
Runs a Hive query or set of commands.
Info | ||
---|---|---|
| ||
As of Hive 0.13.0, GET version/hive displays the Hive version used for the query or commands. |
URL
http://
www.myserver.com/templeton/v1/hive
...
Name | Description | Required? | Default |
---|---|---|---|
execute | String containing an entire, short Hive program to run. | One of either "execute" or "file" is required. | None |
file | HDFS file name of a Hive program to run. | One of either "execute" or "file" is required. | None |
define | Set a Hive configuration variable using the syntax | Optional | None |
arg | Set a program argument. This parameter was introduced in Hive 0.12.0. (See HIVE-4444.) | Optional in Hive 0.12.0+ | None |
files | Comma-separated files to be copied to the map reduce cluster. This parameter was introduced in Hive 0.12.0. (See HIVE-4444.) | Optional in Hive 0.12.0+ | None |
statusdir | A directory where WebHCat will write the status of the Hive job. If provided, it is the caller's responsibility to remove this directory when done. | Optional | None |
enablelog | If statusdir is set and enablelog is "true", collect Hadoop job configuration and logs into a directory named
This parameter was introduced in Hive 0.12.0. (See HIVE-4531.) | Optional in Hive 0.12.0+ | None |
callback | Define a URL to be called upon job completion. You may embed a specific job ID into this URL using | Optional | None |
...
Name | Description |
---|---|
id | A string containing the job ID similar to "job_201110132141_0001". |
info | A JSON object containing the information returned when the job was queued. See the Hadoop documentation ( |
Example
Curl Command
No Format |
---|
% curl -s -d user.name=ctdean \ -d execute="select+*+from+pokes;" \ -d statusdir="pokes.output" \ 'http://localhost:50111/templeton/v1/hive?user.name=ekoifman' |
Info | ||
---|---|---|
| ||
Prior to Hive 0.13.0, user.name was specified in POST requests as a form parameter: In Hive 0.13.0 onward, user.name should be specified in the query string (as shown above): |
JSON Output
No Format |
---|
{ "id": "job_201111111311_0005", "info": { "stdout": "templeton-job-id:job_201111111311_0005 ", "stderr": "", "exitcode": 0 } } |
...
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
Previous: POST pig General: WebHCat Reference – WebHCat Manual – HCatalog Manual – Hive Wiki Home – Hive Project Site |