incubator-oozie-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Ernst <ker...@mobileposse.com>
Subject Re: Oozie decision action - Switch / Case predicate
Date Tue, 25 Oct 2011 21:06:03 GMT
Any help on this as to wether I am doing something wrong or this is a bug
would be greatly appreciated.

Thanks.


Ken




On 10/24/11 12:50 PM, "Ken Ernst" <kernst@mobileposse.com> wrote:

>OK, so I retract that this is working properly...
>
>It looks like that the predicate is a byte by byte string compare?
>
>Here is my job definition... (all from the oozie console)
>-----------------------------------------------------------
><workflow-app xmlns='uri:oozie:workflow:0.1' name='consolidate-files-wf'>
> <start to='check-return' />
> <decision name="check-return">  <switch>
>   <case to="end">${param02 ge param01}</case>
>   <case to="end">${param03 ge param01}</case>
>   <case to="end">${param04 ge param01}</case>
>   <case to="end">${param05 ge param01}</case>
>   <case to="end">${param06 ge param01}</case>
>   <default to="end"/>  </switch>
> </decision>
> <kill name="fail">   <message>Directory consolidation for ${tableName}
>failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
> </kill>
> <end name='end' />
></workflow-app>
>-----------------------------------------------------------
>Here is the job configuration (irrelevant properties removed)
>-----------------------------------------------------------
><configuration>
>
>  <property>
>    <name>param01</name>
>    <value>15</value>
>  </property>
>  <property>    <name>param02</name>
>    <value>2</value>
>  </property>
>
>  <property>    
>    <name>param03</name>
>    <value>4</value>
>  </property>
>
>  <property>    
>    <name>param04</name>    <value>04</value>
>  </property>
>
>  <property>    <name>param05</name>
>    <value>11</value>
>  </property>
>  <property>
>    <name>param06</name>
>    <value>16</value>
>  </property>
>
></configuration>
>---------------------------------------
>And the relevant piece of the job log with annotations... ---
>------------------------------------
>ACTION[0000384-111021075506415-oozie-oozi-W@check-return] Start, name
>[check-return] type [switch] configuration
>
><switch xmlns="uri:oozie:workflow:0.1">
>  <case to="end">true</case> --- 2 ge 15 (should have been false)
>  <case to="end">true</case> --- 4 ge 15 (should have been false)
>  <case to="end">false</case>--- 04 ge 15 (OK)
>  <case to="end">false</case>--- 11 ge 15 (OK)
>  <case to="end">true</case> --- 16 ge 15 (OK)
>  <default to="end" />
></switch>
>
>2011-10-24 11:38:43,962  WARN ActionStartCommand:528 - USER[
>
>--------------------------------------
>
>
>
>
>
>
>
>
>On 10/24/11 10:43 AM, "Ken Ernst" <kernst@mobileposse.com> wrote:
>
>>Tried to reproduce this issue and could not - must have had a typo
>>somewhere... This is a workflow calling a sub-workflow...
>>
>>Parameters do work on the right hand side of the predicate.
>>
>>
>>Ken Ernst
>>
>>
>>On 10/22/11 12:28 PM, "Alejandro Abdelnur" <tucu@cloudera.com> wrote:
>>
>>
>>>Hi Ken,
>>>
>>>Would you check, in the oozie webconsole, for your decision node action,
>>>the
>>>configuration after the run? It should have all values of EL functions
>>>resolved.
>>>
>>>Thanks.
>>>
>>>Alejandro
>>>
>>>On Sat, Oct 22, 2011 at 6:05 AM, Ken Ernst <kernst@mobileposse.com>
>>>wrote:
>>>
>>>> Hello,
>>>> I want to parameterize the right had side of the predicate in a case
>>>> statement but it does not seem to work. It always returns false. Does
>>>>anyone
>>>> know of why this would not work? For example I have the following
>>>>decision
>>>> control node where the the right hand side of the case predicate is
>>>>12,
>>>> however I would like to make this a job property (I.e.
>>>>fileThresholdCount).
>>>>
>>>> This works (returns true when the output of my java action
>>>> 'dir.numberOfFiles' is greater than 12).
>>>> -----------------------------------------------------------
>>>>  <decision name="check-return">
>>>>    <switch>
>>>>      <case
>>>> 
>>>>to="hive-consolidate-dir">${wf:actionData('hfsNumFiles')['dir.numberOfF
>>>>i
>>>>l
>>>>es']
>>>> ge 12}</case>
>>>>      <default to="end"/>
>>>>    </switch>
>>>>  </decision>
>>>> -----------------------------------------------------------
>>>>
>>>> These do not seem to work, always returns false.
>>>>
>>>> -----------------------------------------------------------
>>>>  <decision name="check-return">
>>>>    <switch>
>>>>      <case
>>>> 
>>>>to="hive-consolidate-dir">${wf:actionData('hfsNumFiles')['dir.numberOfF
>>>>i
>>>>l
>>>>es']
>>>> ge wf:conf('fileThresholdCount')}</case>
>>>>      <default to="end"/>
>>>>    </switch>
>>>>  </decision>
>>>>
>>>>  <decision name="check-return">
>>>>    <switch>
>>>>      <case
>>>> 
>>>>to="hive-consolidate-dir">${wf:actionData('hfsNumFiles')['dir.numberOfF
>>>>i
>>>>l
>>>>es']
>>>> ge  fileThresholdCount}</case>
>>>>      <default to="end"/>
>>>>    </switch>
>>>>  </decision>
>>>> -----------------------------------------------------------
>>>>
>>>> Thanks!
>>>>
>>>> Ken Ernst
>>>>
>>>>
>>>>
>>
>


Mime
View raw message