<?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: Use NIFI to aggregate data in SQL in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-NIFI-to-aggregate-data-in-SQL/m-p/165657#M41495</link>
    <description>&lt;P&gt;Thanks Matt for your help &lt;/P&gt;&lt;P&gt;do you have any similar example for using ExecuteScript with any of the code you mentioned ? &lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2016 13:51:25 GMT</pubDate>
    <dc:creator>hady_ziade</dc:creator>
    <dc:date>2016-09-23T13:51:25Z</dc:date>
    <item>
      <title>Use NIFI to aggregate data in SQL</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-NIFI-to-aggregate-data-in-SQL/m-p/165655#M41493</link>
      <description>&lt;P&gt;Hi , i have a file that we use as configuration file contains a key value pair in the following format  ParamName : ParamValue .   &lt;/P&gt;&lt;P&gt;i need to create a nifi workflow to read from this Parameter file and use its values as attributes to use it to construct a sql query . that will be used to aggregate data . &lt;/P&gt;&lt;P&gt;for example :    Offset : 2 &lt;/P&gt;&lt;P&gt;insert into table1 select ....... from table2 where date_time &amp;gt; timestampadd(day,${Offset},getdate())&lt;/P&gt;&lt;P&gt;its very important for us to use a configuration file instead of hardcode these values in each workflow since we will have many workflows reading from the same file . &lt;/P&gt;&lt;P&gt;am not able to create such workflow in NIFI , any suggestions would be appreciated .... &lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 21:48:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-NIFI-to-aggregate-data-in-SQL/m-p/165655#M41493</guid>
      <dc:creator>hady_ziade</dc:creator>
      <dc:date>2016-09-22T21:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Use NIFI to aggregate data in SQL</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-NIFI-to-aggregate-data-in-SQL/m-p/165656#M41494</link>
      <description>&lt;P&gt;There are a couple of options:&lt;/P&gt;&lt;P&gt;1) If you want one SQL query per parameter, you can use ListFile/FetchFile (or GetFile if you want to repeatedly get the config file) to retrieve the configuration file, then SplitText to split each line (so one parameter per flow file), then ExtractText to get the name and value of the parameter, then ReplaceText to build a SQL query using &lt;A target="_blank" href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html"&gt;Expression Language&lt;/A&gt; and the name of the parameter (which will fill in the value), such as the example statement you have above.&lt;/P&gt;&lt;P&gt;2) If you want to build a single statement with possibly multiple parameters, you could use &lt;A target="_blank" href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.script.ExecuteScript/index.html"&gt;ExecuteScript&lt;/A&gt; (if you are comfortable writing code in Groovy, Jython, JRuby, JavaScript, or Lua) to read in the configuration file, split the lines to build a map of parameter names to values, then write out a SQL statement with the names and/or values as you have done above.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 21:55:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-NIFI-to-aggregate-data-in-SQL/m-p/165656#M41494</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2016-09-22T21:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Use NIFI to aggregate data in SQL</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-NIFI-to-aggregate-data-in-SQL/m-p/165657#M41495</link>
      <description>&lt;P&gt;Thanks Matt for your help &lt;/P&gt;&lt;P&gt;do you have any similar example for using ExecuteScript with any of the code you mentioned ? &lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 13:51:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-NIFI-to-aggregate-data-in-SQL/m-p/165657#M41495</guid>
      <dc:creator>hady_ziade</dc:creator>
      <dc:date>2016-09-23T13:51:25Z</dc:date>
    </item>
  </channel>
</rss>

