<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Oozie, how to use the output of an action as arguments for next action in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Oozie-how-to-use-the-output-of-an-action-as-arguments-for/m-p/383212#M244854</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105727"&gt;@Sokka&lt;/a&gt;&amp;nbsp;, I think its possible, can you try the below?&lt;BR /&gt;&lt;BR /&gt;"""&amp;lt;workflow-app name="Workflow" xmlns="uri:oozie:workflow:0.5"&amp;gt;&lt;BR /&gt;&amp;lt;start to="hive-04f4"/&amp;gt;&lt;BR /&gt;&amp;lt;kill name="Kill"&amp;gt;&lt;BR /&gt;&amp;lt;message&amp;gt;Error al realizar la acción. Mensaje de error [${wf:errorMessage(wf:lastErrorNode())}]&amp;lt;/message&amp;gt;&lt;BR /&gt;&amp;lt;/kill&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!-- First Hive action to read data --&amp;gt;&lt;BR /&gt;&amp;lt;action name="hive-04f4" cred="hive2"&amp;gt;&lt;BR /&gt;&amp;lt;hive2 xmlns="uri:oozie:hive2-action:0.1"&amp;gt;&lt;BR /&gt;&amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;&lt;BR /&gt;&amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;&lt;BR /&gt;&amp;lt;jdbc-url&amp;gt;jdbc:hive2://host:10000/default&amp;lt;/jdbc-url&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;${wf:appPath()}/hive-04f4.sql&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;!-- Set output property to be used in next action --&amp;gt;&lt;BR /&gt;&amp;lt;capture-output/&amp;gt;&lt;BR /&gt;&amp;lt;/hive2&amp;gt;&lt;BR /&gt;&amp;lt;ok to="loop-decision"/&amp;gt;&lt;BR /&gt;&amp;lt;error to="Kill"/&amp;gt;&lt;BR /&gt;&amp;lt;/action&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!-- Decision node to determine whether to execute next action --&amp;gt;&lt;BR /&gt;&amp;lt;decision name="loop-decision"&amp;gt;&lt;BR /&gt;&amp;lt;switch&amp;gt;&lt;BR /&gt;&amp;lt;!-- If output is not null, execute next action --&amp;gt;&lt;BR /&gt;&amp;lt;case to="hive-1c24"&amp;gt;${wf:actionData('hive-04f4')['output'] != null}&amp;lt;/case&amp;gt;&lt;BR /&gt;&amp;lt;/switch&amp;gt;&lt;BR /&gt;&amp;lt;!-- If output is null, end the workflow --&amp;gt;&lt;BR /&gt;&amp;lt;default to="End"/&amp;gt;&lt;BR /&gt;&amp;lt;/decision&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!-- Second Hive action to write data --&amp;gt;&lt;BR /&gt;&amp;lt;action name="hive-1c24" cred="hive2"&amp;gt;&lt;BR /&gt;&amp;lt;hive2 xmlns="uri:oozie:hive2-action:0.1"&amp;gt;&lt;BR /&gt;&amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;&lt;BR /&gt;&amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;&lt;BR /&gt;&amp;lt;jdbc-url&amp;gt;jdbc:hive2://host:10000/default&amp;lt;/jdbc-url&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;${wf:appPath()}/hive-1c24.sql&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;!-- Use output from previous action as input parameter --&amp;gt;&lt;BR /&gt;&amp;lt;param&amp;gt;input=${wf:actionData('hive-04f4')['output']}&amp;lt;/param&amp;gt;&lt;BR /&gt;&amp;lt;/hive2&amp;gt;&lt;BR /&gt;&amp;lt;ok to="join"/&amp;gt;&lt;BR /&gt;&amp;lt;error to="Kill"/&amp;gt;&lt;BR /&gt;&amp;lt;/action&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!-- Join node to synchronize paths after the second action --&amp;gt;&lt;BR /&gt;&amp;lt;join name="join" to="loop-decision"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;end name="End"/&amp;gt;&lt;BR /&gt;&amp;lt;/workflow-app&amp;gt;"""&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The &lt;/SPAN&gt;&amp;lt;decision&amp;gt;&lt;SPAN&gt; node (&lt;/SPAN&gt;loop-decision&lt;SPAN&gt;) contains a &lt;/SPAN&gt;&amp;lt;switch&amp;gt;&lt;SPAN&gt; element with a single &lt;/SPAN&gt;&amp;lt;case&amp;gt;&lt;SPAN&gt; element to check if the output of the first Hive action (&lt;/SPAN&gt;hive-04f4&lt;SPAN&gt;) is not null. If it's not null, it proceeds to execute the second Hive action (&lt;/SPAN&gt;hive-1c24&lt;SPAN&gt;). If it is null, it goes to the &lt;/SPAN&gt;&amp;lt;default&amp;gt;&lt;SPAN&gt; path, which ends the workflow.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chethan YM&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2024 14:13:25 GMT</pubDate>
    <dc:creator>ChethanYM</dc:creator>
    <dc:date>2024-02-06T14:13:25Z</dc:date>
    <item>
      <title>Oozie, how to use the output of an action as arguments for next action</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Oozie-how-to-use-the-output-of-an-action-as-arguments-for/m-p/382691#M244657</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;I'm new to using oozie and I've been trying to figure out how to use the output of an action as the input of the next action in Oozie.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;I'm actually coming from using traditional ETLs, where the output of one Step can be used as arguments in the next Step.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;My question is whether the following points are possible with Oozie:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Use the output of one action as the input of the next action&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Let a subsequent action be executed "n" times according to the output of the first action.&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;Like&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;&amp;nbsp;sub jobs or something.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Actually, in order to know if this is possible, we are trying to run a very basic dump example where we read and insert with two hive actions, one for read a table and another one to write. Something like the following example created with Hue Oozie Editor.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;workflow-app name="Workflow" xmlns="uri:oozie:workflow:0.5"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;start to="hive-04f4"/&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;kill name="Kill"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;message&amp;gt;Error al realizar la acción. Mensaje de error [${wf:errorMessage(wf:lastErrorNode())}]&amp;lt;/message&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/kill&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;action name="hive-04f4" cred="hive2"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;hive2 xmlns="uri:oozie:hive2-action:0.1"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;jdbc-url&amp;gt;jdbc:hive2://host:10000/default&amp;lt;/jdbc-url&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;${wf:appPath()}/hive-04f4.sql&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/hive2&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;ok to="hive-1c24"/&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;error to="Kill"/&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/action&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;action name="hive-1c24" cred="hive2"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;hive2 xmlns="uri:oozie:hive2-action:0.1"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;jdbc-url&amp;gt;jdbc:hive2://host:10000/default&amp;lt;/jdbc-url&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;${wf:appPath()}/hive-1c24.sql&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;param&amp;gt;fecha=${fecha_insercion}&amp;lt;/param&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;param&amp;gt;registro=${now}&amp;lt;/param&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/hive2&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;ok to="End"/&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;error to="Kill"/&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/action&amp;gt;&lt;BR /&gt;&amp;lt;end name="End"/&amp;gt;&lt;BR /&gt;&amp;lt;/workflow-app&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 02:08:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Oozie-how-to-use-the-output-of-an-action-as-arguments-for/m-p/382691#M244657</guid>
      <dc:creator>Sokka</dc:creator>
      <dc:date>2024-01-25T02:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Oozie, how to use the output of an action as arguments for next action</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Oozie-how-to-use-the-output-of-an-action-as-arguments-for/m-p/383212#M244854</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105727"&gt;@Sokka&lt;/a&gt;&amp;nbsp;, I think its possible, can you try the below?&lt;BR /&gt;&lt;BR /&gt;"""&amp;lt;workflow-app name="Workflow" xmlns="uri:oozie:workflow:0.5"&amp;gt;&lt;BR /&gt;&amp;lt;start to="hive-04f4"/&amp;gt;&lt;BR /&gt;&amp;lt;kill name="Kill"&amp;gt;&lt;BR /&gt;&amp;lt;message&amp;gt;Error al realizar la acción. Mensaje de error [${wf:errorMessage(wf:lastErrorNode())}]&amp;lt;/message&amp;gt;&lt;BR /&gt;&amp;lt;/kill&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!-- First Hive action to read data --&amp;gt;&lt;BR /&gt;&amp;lt;action name="hive-04f4" cred="hive2"&amp;gt;&lt;BR /&gt;&amp;lt;hive2 xmlns="uri:oozie:hive2-action:0.1"&amp;gt;&lt;BR /&gt;&amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;&lt;BR /&gt;&amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;&lt;BR /&gt;&amp;lt;jdbc-url&amp;gt;jdbc:hive2://host:10000/default&amp;lt;/jdbc-url&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;${wf:appPath()}/hive-04f4.sql&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;!-- Set output property to be used in next action --&amp;gt;&lt;BR /&gt;&amp;lt;capture-output/&amp;gt;&lt;BR /&gt;&amp;lt;/hive2&amp;gt;&lt;BR /&gt;&amp;lt;ok to="loop-decision"/&amp;gt;&lt;BR /&gt;&amp;lt;error to="Kill"/&amp;gt;&lt;BR /&gt;&amp;lt;/action&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!-- Decision node to determine whether to execute next action --&amp;gt;&lt;BR /&gt;&amp;lt;decision name="loop-decision"&amp;gt;&lt;BR /&gt;&amp;lt;switch&amp;gt;&lt;BR /&gt;&amp;lt;!-- If output is not null, execute next action --&amp;gt;&lt;BR /&gt;&amp;lt;case to="hive-1c24"&amp;gt;${wf:actionData('hive-04f4')['output'] != null}&amp;lt;/case&amp;gt;&lt;BR /&gt;&amp;lt;/switch&amp;gt;&lt;BR /&gt;&amp;lt;!-- If output is null, end the workflow --&amp;gt;&lt;BR /&gt;&amp;lt;default to="End"/&amp;gt;&lt;BR /&gt;&amp;lt;/decision&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!-- Second Hive action to write data --&amp;gt;&lt;BR /&gt;&amp;lt;action name="hive-1c24" cred="hive2"&amp;gt;&lt;BR /&gt;&amp;lt;hive2 xmlns="uri:oozie:hive2-action:0.1"&amp;gt;&lt;BR /&gt;&amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;&lt;BR /&gt;&amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;&lt;BR /&gt;&amp;lt;jdbc-url&amp;gt;jdbc:hive2://host:10000/default&amp;lt;/jdbc-url&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;${wf:appPath()}/hive-1c24.sql&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;!-- Use output from previous action as input parameter --&amp;gt;&lt;BR /&gt;&amp;lt;param&amp;gt;input=${wf:actionData('hive-04f4')['output']}&amp;lt;/param&amp;gt;&lt;BR /&gt;&amp;lt;/hive2&amp;gt;&lt;BR /&gt;&amp;lt;ok to="join"/&amp;gt;&lt;BR /&gt;&amp;lt;error to="Kill"/&amp;gt;&lt;BR /&gt;&amp;lt;/action&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!-- Join node to synchronize paths after the second action --&amp;gt;&lt;BR /&gt;&amp;lt;join name="join" to="loop-decision"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;end name="End"/&amp;gt;&lt;BR /&gt;&amp;lt;/workflow-app&amp;gt;"""&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The &lt;/SPAN&gt;&amp;lt;decision&amp;gt;&lt;SPAN&gt; node (&lt;/SPAN&gt;loop-decision&lt;SPAN&gt;) contains a &lt;/SPAN&gt;&amp;lt;switch&amp;gt;&lt;SPAN&gt; element with a single &lt;/SPAN&gt;&amp;lt;case&amp;gt;&lt;SPAN&gt; element to check if the output of the first Hive action (&lt;/SPAN&gt;hive-04f4&lt;SPAN&gt;) is not null. If it's not null, it proceeds to execute the second Hive action (&lt;/SPAN&gt;hive-1c24&lt;SPAN&gt;). If it is null, it goes to the &lt;/SPAN&gt;&amp;lt;default&amp;gt;&lt;SPAN&gt; path, which ends the workflow.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chethan YM&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 14:13:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Oozie-how-to-use-the-output-of-an-action-as-arguments-for/m-p/383212#M244854</guid>
      <dc:creator>ChethanYM</dc:creator>
      <dc:date>2024-02-06T14:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Oozie, how to use the output of an action as arguments for next action</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Oozie-how-to-use-the-output-of-an-action-as-arguments-for/m-p/383433#M244903</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105727"&gt;@Sokka&lt;/a&gt;,&amp;nbsp;Did the response assist in resolving your query? If it did, kindly mark the relevant reply as the solution, as it will aid others in locating the answer more easily in the future.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 05:03:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Oozie-how-to-use-the-output-of-an-action-as-arguments-for/m-p/383433#M244903</guid>
      <dc:creator>VidyaSargur</dc:creator>
      <dc:date>2024-02-13T05:03:52Z</dc:date>
    </item>
  </channel>
</rss>

