<?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: Nifi/DataFlow example that loops through a list? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-DataFlow-example-that-loops-through-a-list/m-p/145966#M40315</link>
    <description>&lt;P&gt;The key here for me is a shift in thinking.&lt;/P&gt;&lt;P&gt;The SplitJSON processor "splits" my flow into X flows, based on the results of my query. And then I can run Y of them at a time. It's not a quite a loop (unless Y == 1), but it makes sense now.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2016 19:52:48 GMT</pubDate>
    <dc:creator>zack_riesland</dc:creator>
    <dc:date>2016-09-15T19:52:48Z</dc:date>
    <item>
      <title>Nifi/DataFlow example that loops through a list?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-DataFlow-example-that-loops-through-a-list/m-p/145963#M40312</link>
      <description>&lt;P&gt;I'm a total dataflow/nifi rookie.&lt;/P&gt;&lt;P&gt;I'm trying to accomplish something like the following:&lt;/P&gt;&lt;P&gt;Given a database table like this&lt;/P&gt;&lt;P&gt;Customer_ID (varchar), DoA (boolean), DoB (boolean), DoC (boolean)&lt;/P&gt;&lt;P&gt;I want to:&lt;/P&gt;&lt;P&gt;1) query the table (select *)&lt;/P&gt;&lt;P&gt;2) for each customer:&lt;/P&gt;&lt;P&gt;3a) if DoA, execute some steps (move some files around, etc)&lt;/P&gt;&lt;P&gt;3b) if DoB, execute some steps&lt;/P&gt;&lt;P&gt;3c) if DoC, execute some steps&lt;/P&gt;&lt;P&gt;4) Update some logs files, etc.&lt;/P&gt;&lt;P&gt;I've been playing with some of the example templates here: &lt;A href="https://cwiki.apache.org/confluence/display/NIFI/Example+Dataflow+Templates" target="_blank"&gt;https://cwiki.apache.org/confluence/display/NIFI/Example+Dataflow+Templates&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But I haven't found anything to show me how to accomplish step 2 above. &lt;/P&gt;&lt;P&gt;Is it possible to work through a loop like this? &lt;/P&gt;&lt;P&gt;In the nifi training class, the instructor said that this is a common use case, but I can't seem to find a template that looks like this.&lt;/P&gt;&lt;P&gt;Can someone point me at an example to get me going?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2016 20:44:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-DataFlow-example-that-loops-through-a-list/m-p/145963#M40312</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2016-09-10T20:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi/DataFlow example that loops through a list?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-DataFlow-example-that-loops-through-a-list/m-p/145964#M40313</link>
      <description>&lt;P&gt;If I'm understanding the scenario correctly, you would probably do something like this...&lt;/P&gt;&lt;P&gt;- ExecuteSQL/QueryDatabaseTable to get data from the database, produces Avro&lt;/P&gt;&lt;P&gt;- ConvertAvroToJSON or ConvertAvroToCSV, I'm going to use JSON going forward&lt;/P&gt;&lt;P&gt;- SplitJSON to split each record into its own flow file&lt;/P&gt;&lt;P&gt;- EvaluateJSONPath to extract DoA, DoB, and DoC into flow file attributes&lt;/P&gt;&lt;P&gt;From here it kind of depends the logic you want to happen and whether those three fields are mutually exclusive (only one is ever true) or if 2 out of 3 can be true, but you would use RouteOnAttribute with a property like DoA = ${DoA:equals("true")} to send everything that matches that to that relationship, and then send that relationship to the processors you want to perform the logic when DoA is true.&lt;/P&gt;&lt;P&gt;You could have a series of RouteOnAttribute processors, or you could have one with complex statements like:&lt;/P&gt;&lt;P&gt;${DoA:equals("true"):and( ${DoB:equals("false")} )}&lt;/P&gt;&lt;P&gt;You can take a look at the expression language guide for more detail on constructing the right expressions:&lt;/P&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2016 02:29:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-DataFlow-example-that-loops-through-a-list/m-p/145964#M40313</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2016-09-11T02:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi/DataFlow example that loops through a list?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-DataFlow-example-that-loops-through-a-list/m-p/145965#M40314</link>
      <description>&lt;P&gt;Thanks Bryan,&lt;/P&gt;&lt;P&gt;I'll give this a try!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 16:28:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-DataFlow-example-that-loops-through-a-list/m-p/145965#M40314</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2016-09-12T16:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi/DataFlow example that loops through a list?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-DataFlow-example-that-loops-through-a-list/m-p/145966#M40315</link>
      <description>&lt;P&gt;The key here for me is a shift in thinking.&lt;/P&gt;&lt;P&gt;The SplitJSON processor "splits" my flow into X flows, based on the results of my query. And then I can run Y of them at a time. It's not a quite a loop (unless Y == 1), but it makes sense now.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 19:52:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-DataFlow-example-that-loops-through-a-list/m-p/145966#M40315</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2016-09-15T19:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi/DataFlow example that loops through a list?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-DataFlow-example-that-loops-through-a-list/m-p/145967#M40316</link>
      <description>&lt;P&gt;(I posted another nifi question here if anyone reading this has an answer: &lt;A href="https://community.hortonworks.com/questions/56616/options-for-exporting-large-data-sets-from-hive-to.html)" target="_blank"&gt;https://community.hortonworks.com/questions/56616/options-for-exporting-large-data-sets-from-hive-to.html)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 19:53:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-DataFlow-example-that-loops-through-a-list/m-p/145967#M40316</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2016-09-15T19:53:05Z</dc:date>
    </item>
  </channel>
</rss>

