<?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: Adding columns to sql in nifi in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Adding-columns-to-sql-in-nifi/m-p/224602#M79735</link>
    <description>&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jun 2018 15:52:47 GMT</pubDate>
    <dc:creator>vscherbakov</dc:creator>
    <dc:date>2018-06-21T15:52:47Z</dc:date>
    <item>
      <title>Adding columns to sql in nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Adding-columns-to-sql-in-nifi/m-p/224598#M79731</link>
      <description>&lt;P&gt;I figured out how to add data from the server to the database *applause*.&lt;BR /&gt;But the question arose: can I add an extra column with file name/id in the data that I load into the database to understand the data from which file I'm using. Mbe nifi got some processor toadd persistent data to each line before we take them into database?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 23:31:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Adding-columns-to-sql-in-nifi/m-p/224598#M79731</guid>
      <dc:creator>vscherbakov</dc:creator>
      <dc:date>2018-06-19T23:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns to sql in nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Adding-columns-to-sql-in-nifi/m-p/224599#M79732</link>
      <description>&lt;P&gt;Yes, if what you are asking is to add an extra piece of data to a NiFi FlowFile then you can do that.&lt;/P&gt;&lt;P&gt;What I am not sure of is the format of the data in your FlowFile - is it JSON, CSV, something else? If it is a human-readable format, you can use the ReplaceText processor to add more data into your FlowFile content. You'll need to modify your destination table schema and add another column to it assuming you're using Hive to read the data. The ReplaceText processor accepts statements in NiFi expression language so you'll want to read up on that to find out how to best find your string location and then insert text into it.&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>Wed, 20 Jun 2018 05:56:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Adding-columns-to-sql-in-nifi/m-p/224599#M79732</guid>
      <dc:creator>anarasimham</dc:creator>
      <dc:date>2018-06-20T05:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns to sql in nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Adding-columns-to-sql-in-nifi/m-p/224600#M79733</link>
      <description>&lt;P&gt;Thanks! I think this should solve my problem!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 17:35:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Adding-columns-to-sql-in-nifi/m-p/224600#M79733</guid>
      <dc:creator>vscherbakov</dc:creator>
      <dc:date>2018-06-20T17:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns to sql in nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Adding-columns-to-sql-in-nifi/m-p/224601#M79734</link>
      <description>&lt;P&gt;You can use UpdateRecord to add a field to your records, then PutDatabaseRecord to put it into your database. Using the record-aware processors allows you better control over the content (rather than ReplaceText which can be brittle and only supports things like CSV and JSON, not Avro), and you don't need to use the Split/Merge pattern; instead these processors operate on many records in a single flow file, making things more efficient.&lt;/P&gt;&lt;P&gt;If the table has already been created and you are trying to insert new rows with an additional column, then (as of NiFi 1.5.0) you might be able to use PutSQL before PutDatabaseRecord to execute a statement like ALTER TABLE ADD COLUMN IF NOT EXISTS or something like that, but it is probably better to issue that statement once on your table externally so you don't need to do that for each flow file coming through NiFi.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 21:53:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Adding-columns-to-sql-in-nifi/m-p/224601#M79734</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2018-06-20T21:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns to sql in nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Adding-columns-to-sql-in-nifi/m-p/224602#M79735</link>
      <description>&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 15:52:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Adding-columns-to-sql-in-nifi/m-p/224602#M79735</guid>
      <dc:creator>vscherbakov</dc:creator>
      <dc:date>2018-06-21T15:52:47Z</dc:date>
    </item>
  </channel>
</rss>

