[Solved-1 Solution] Submit pig job from oozie ?
What is oozie
- Apache Oozie is a Java Web application used to schedule Apache Hadoop jobs. Oozie combines multiple jobs sequentially into one logical unit of work.
- It is integrated with the Hadoop stack, with YARN as its architectural center, and supports Hadoop jobs for Apache MapReduce, Apache Pig, Apache Hive, and Apache Sqoop. Oozie can also schedule jobs specific to a system, like Java programs or shell scripts.
Problem:
You are working on automating Pig jobs using oozie in hadoop cluster.
You are able to run a sample pig script from oozie but your next requirement is to run a pig job where the pig script receives its input parameters from a shell script. please share your answer.
Solution 1:
- How can we pass a parameter form a shell script output.
Here's the working example:
WORKFLOW.XML
- If we replace the 2nd shell action with your pig action and pass the param to the pig script like this:
SO.SH
SO2.SH
Regarding sharelib issue, we have to be sure that in the properties we configured the LIB_PATH=where/we/jars/are and hand over this param to the pig action,
than just register the jars from there:
- Map wf:actionData(String node)
- This function is only applicable to action nodes that produce output data on completion.
- The output data is in a Java Properties format and via this EL function it is available as a Map .
If the capture-output element is present, it indicates Oozie to capture output of the STDOUT of the shell command execution. The Shell command output must be in Java Properties file format and it must not exceed 2KB.
Here you can use simple work-a-round and execute your shell script in the pig itself and save it's result in a variable, and using that. Like this: