Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Oozie HDFS action use file patterns or glob?

Tags:

oozie

Can I use wildcards (e.g. *) or file patterns (e.g. {}) in Oozie move actions?

I am trying to move the results of my job into archiving directory.

State of the directory structure:

output
 - 201304
 - 201305
archive
 - 201303

My action:

<fs name="archive-files">
    <move source="hdfs://namenode/output/{201304,201305}"
          target="hdfs://namenode/archive" />
    <ok to="next"/>
    <error to="fail"/>
</fs>

resulting error:

FS006: move, source path [hdfs://namenode/output/{201304,201305}] does not exist

Is there an easy way to move more than one file in a glob or bash like syntax? Looking to do something similar to this hadoop command:

hadoop fs -mv hdfs://namenode/output/{201304,201305} hdfs://namenode/archive

Am I missing something? The hadoop fs command accepts glob. Does Oozie?

like image 633
subsetOfInsanity Avatar asked Nov 23 '22 23:11

subsetOfInsanity


1 Answers

Oozie HDFS action has quite limited functionality, which is fully described in functional specification. To do something more complicated you can use Shell action. It allows to run arbitrary shell commands as part of workflow, e.g. hadoop fs in your case.

like image 130
Dmitry Avatar answered Nov 27 '22 00:11

Dmitry