How do I create and set variables in oozie workflows?

5.1k Views Asked by At

How do I set variables in Oozie workflows?

For example the workflow here has an ${output} variable but where would it be set?

Is 'output' a special word, and if so how do I create my own variables?

Update: I am using hadoop streaming with Python, not Java.

2

There are 2 best solutions below

3
On BEST ANSWER

Output is not a special word. The value of this variable will be passed to this workflow during the execution time using job.properties file. You can see an example job.properties file where all the variables related cluster details, environment and many other are kept as variables.

0
On

You have to use any variable name instead of OUTPUT.it is a parameter name only.this parameter is used instead of the output file. It is used for storing the output value during the execution of workflow or coordinator sample only. The variable name should defined in your workflow/coordinator sample like as follows...

<param> OUTPUT=/user/${wf:user()}/${exampleRoot}/output-data/hive</param>

If you want to see that parameter file,check the path specified in the <param> tag.

Storing the value to that parameter like as follows.

store (alias) into '$OUTPUT';