Support Questions
Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

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

Rising Star

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 ......

1 REPLY 1

Master Guru
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.