Reply
Explorer
Posts: 11
Registered: ‎12-21-2016

Getting error when Oozie shell fs action - hdfs file exists or not

[ Edited ]

I am getting error which i am trying to check if the hdfs directory or not and i am trying check it through oozie fs action and below is the code, however, i am getting error. Appreciate any help on this.

 

</action> <decision name="deleteFrompraveenPostCondition">

<switch> 

<case to="Export">

${fs:exists(/dev/praveen/test/*)} 

</case>

<default to="statusLog"/>

</switch>

</decision>

--------------------------------- ERROR ----------------------------------------------------------

Encountered "/", expected one of [<INTEGER_LITERAL>, <FLOATING_POINT_LITERAL>, <STRING_LITERAL>, "true", "false", "null", "(", ")", "-", "not", "!", "empty", <IDENTIFIER>]

Appreciate any help on this ......

Posts: 1,525
Kudos: 266
Solutions: 232
Registered: ‎07-31-2013

Re: Getting error when Oozie shell fs action - hdfs file exists or not

The path literal for fs:exists must be quoted as a string (with single or double quotes). See usage example at http://archive.cloudera.com/cdh5/cdh/5/oozie/WorkflowFunctionalSpec.html#a3.1.4_Decision_Control_Nod...

Also, you cannot use Globbing paths with the exists function, only with move , delete , chmod and chgrp.
Backline Customer Operations Engineer
Announcements