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.

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

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

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

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.