Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

oozie decision node.... where to define the variable

oozie decision node.... where to define the variable

Contributor

Here is my decision node: 

 

    <decision name="hasDiffs">
        <switch>
            <case to="email_diffs">
              ${ fs:fileSize(secondjobOutputDir) gt 0 }
            </case>
            <case to="noop">
              ${ fs:fileSize(secondjobOutputDir) eq 0 }
            </case>
            <default to="end"/>
        </switch>
    </decision>

 

Variabe secondjobOutputDir is the output from a hive-active (INSERT OVERWRITE DIRECTORY.....)in the workflow node before the decision.

 

Where should I define this variable?  I am using hue oozie UI. The logical location to define this should be in the decision node, but this is not available via oozie ui.

 

Any help on this is much appreciated.

 

 

 

 

3 REPLIES 3

Re: oozie decision node.... where to define the variable

Expert Contributor
The decision node is available in Hue's workflow builder. Fork nodes are converted to decision nodes in the UI. To create a fork node, you need to drag and drop one node on top of another node.

Check out http://gethue.com/the-dynamic-workflow-builder-in-hue/ for more info. The video is a bit old, but is still valid.

Also, if you already have a workflow XML file, you should be able to import it. You can then just modify the workflow using the workflow builder.

Here's a quick tutorial on how-to import a workflow: http://gethue.com/how-to-import-a-pre-existing-oozie-workflow-into-hue/

Re: oozie decision node.... where to define the variable

Contributor
Hi, you can convert a Fork node to a Decision node. Look at the little tool
icon on a Fork node.

Romain

Highlighted

Re: oozie decision node.... where to define the variable

Contributor

Right,  that was how I created the decision node. ...Fork node then convert to decision node, then edited it with my decisions if {}...  the snapshot is the generated workflow.xml for this decision node. 

 

My question is about the variable used in the decision..... secondjobOutputDir.   I can't hardcode the file path because it hase ${date} which will be passed down from oozie coordinator.  How and where can I define this parameter? 

 

For example, in a hive action, I can used variables in the query to my heart's content, then define the parameters to link up coordinator input/output to them. 

 

It seems for a decision node, I don't have this ability to define the variable.  Or am I missing something?