Pig Job — POST pig
Table of Contents |
---|
Description
Create and queue a Pig job.
...
Name | Description | Required? | Default |
---|---|---|---|
execute | String containing an entire, short Pig program to run. | One of either "execute" or "file" is required. | None |
file | HDFS file name of a Pig program to run. | One of either "execute" or "file" is required. | None |
arg | Set a program argument. If | Optional | None |
files | Comma separated files to be copied to the map reduce cluster. | Optional | None |
statusdir | A directory where WebHCat will write the status of the Map Reduce Pig 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 |
usehcatalog | Specify that the submitted job uses HCatalog and therefore needs to access the metastore, which requires additional steps for WebHCat to perform in a secure cluster. (See HIVE-5133.) This parameter will be introduced in Hive 0.13.0. It can also be set to "true" by including | Optional in Hive 0.13.0+ | false |
The standard parameters are also supported.
Results
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
Code and Data Setup
No Format |
---|
% cat id.pig
A = load 'passwd' using PigStorage(':');
B = foreach A generate $0 as id;
dump B;
% cat fake-passwd
ctdean:Chris Dean:secret
pauls:Paul Stolorz:good
carmas:Carlos Armas:evil
dra:Deirdre McClure:marvelous
% hadoop fs -put id.pig .
% hadoop fs -put fake-passwd passwd
|
Curl Command
No Format |
---|
% curl -s -d user.name=ctdean \ -d file=id.pig \ -d arg=-v \ 'http://localhost:50111/templeton/v1/pig?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_201111101627_0018",
"info": {
"stdout": "templeton-job-id:job_201111101627_0018
",
"stderr": "",
"exitcode": 0
}
}
|
...
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
Previous: POST mapreduce/jar General: WebHCat Reference – WebHCat (Templeton) Manual – HCatalog Manual – Hive Home |