Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to pass table names from file to oozie workflow


How to pass table names from file to oozie workflow


I have a workflow in `oozie`. In this workflow I want to pass a table name as an argument.

The table names are present in a file `tables.txt`. I want to pass the table names from `tables.txt` to the workflow.


<workflow-app name="Shell_test" xmlns="uri:oozie:workflow:0.5">
    <start to="shell-8f63"/>
    <kill name="Kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    <action name="test_shell">
        <shell xmlns="uri:oozie:shell-action:0.1">
        <ok to="End"/>
            <error to="email-error"/>
        <action name="email-error">
        <email xmlns="uri:oozie:email-action:0.2">
            <subject>Status of workflow ${table}</subject>
            <body>The workflow ${table} ${wf:id()} had issues and was killed. The error message is: ${wf:errorMessage(wf:lastErrorNode())}</body>
        <ok to="end"/>
        <error to="end"/>
        <end name="End"/>

I was able to do this using the following in the workflow.




Now I have a problem.


Say If the workflow fails for one of the tables in the `input_file` then I am not getting any email. I am getting email only if the workflow fails for the last table in the `input_file`.


Why is this happening and How can I get an email for every time the workflow fails? Or am I doing the whole process wrong.


Could anyone please explain and correct me where I am doing things in a wrong way.

Don't have an account?
Coming from Hortonworks? Activate your account here