<?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 reject invalid csv files in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/reject-invalid-csv-files/m-p/370408#M240731</link>
    <description>&lt;P&gt;I need to create a flow that rejects csv files if there are invalid records determined using ValidateRecord processor. I would like to just report those invalid records and stop it there and&amp;nbsp; do not want to process the valid records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone please help with the flow&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2023 03:56:07 GMT</pubDate>
    <dc:creator>nuxeo-nifi</dc:creator>
    <dc:date>2023-05-10T03:56:07Z</dc:date>
    <item>
      <title>reject invalid csv files</title>
      <link>https://community.cloudera.com/t5/Support-Questions/reject-invalid-csv-files/m-p/370408#M240731</link>
      <description>&lt;P&gt;I need to create a flow that rejects csv files if there are invalid records determined using ValidateRecord processor. I would like to just report those invalid records and stop it there and&amp;nbsp; do not want to process the valid records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone please help with the flow&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 03:56:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/reject-invalid-csv-files/m-p/370408#M240731</guid>
      <dc:creator>nuxeo-nifi</dc:creator>
      <dc:date>2023-05-10T03:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: reject invalid csv files</title>
      <link>https://community.cloudera.com/t5/Support-Questions/reject-invalid-csv-files/m-p/370422#M240732</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/104992"&gt;@nuxeo-nifi&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;What I would try to implement as a quick solution is:&lt;BR /&gt;1. Configure your &lt;STRONG&gt;ValidateRecord&lt;/STRONG&gt; (or even maybe try &lt;STRONG&gt;ValidateCSV&lt;/STRONG&gt;) so it identifies when your Records from your CSV are not valid.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2. From &lt;STRONG&gt;ValidateRecord&lt;/STRONG&gt;, you have 3 possible queues:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;failure --&amp;gt; which you might want connect to an alert system, like &lt;STRONG&gt;PutEmail&lt;/STRONG&gt; for example.&lt;/LI&gt;&lt;LI&gt;valid --&amp;gt; which you might want to connect to your further processing.&lt;/LI&gt;&lt;LI&gt;invalid --&amp;gt; what you are actually looking for :). Here, you can use an &lt;STRONG&gt;InvokeHTTP&lt;/STRONG&gt; to call &lt;STRONG&gt;NiFi's REST API&lt;/STRONG&gt; and stop your &lt;STRONG&gt;ValidateRecord&lt;/STRONG&gt; Processor. In this way, if a single message was rejected, your entire flow will be stopped... this is actually not the best way to do things but if this is your project requirement, this is what you should do.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2a. From &lt;STRONG&gt;ValidateCSV&lt;/STRONG&gt;, you have 2 possible queues:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;valid&lt;/STRONG&gt; --&amp;gt; which you might want to connect to your further processing.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;invalid&lt;/STRONG&gt; --&amp;gt; what you are actually looking for :). Here, you can use an &lt;STRONG&gt;InvokeHTTP&lt;/STRONG&gt; to call&lt;STRONG&gt; NiFi's REST API&lt;/STRONG&gt; and stop your &lt;STRONG&gt;ValidateCSV&lt;/STRONG&gt; Processor. In this way, if a single message was rejected, your entire flow will be stopped... this is actually not the best way to do things but if this is your project requirement, this is what you should do.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;3. If you are using this Flow in a so to say Streaming mode (you get files every second), you should modify &lt;STRONG&gt;ValidateRecord&lt;/STRONG&gt; to &lt;STRONG&gt;run every 5 seconds or every 2 seconds&lt;/STRONG&gt; (or something like that) so you have time to stop your processor using &lt;STRONG&gt;InvokeHTTP&lt;/STRONG&gt;. If you leave it by default on &lt;STRONG&gt;Run Schedule 0 sec&lt;/STRONG&gt;, &lt;STRONG&gt;you will process some additional messages before being able to stop your processor.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Documentation:&lt;BR /&gt;NiFi Rest API: &lt;A href="https://nifi.apache.org/docs/nifi-docs/rest-api/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/rest-api/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;NiFi ValidateRecord: &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.20.0/org.apache.nifi.processors.standard.ValidateRecord/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.20.0/org.apache.nifi.processors.standard.ValidateRecord/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;NiFi InvokeHTTP: &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.20.0/org.apache.nifi.processors.standard.InvokeHTTP/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.20.0/org.apache.nifi.processors.standard.InvokeHTTP/index.html&lt;/A&gt;&lt;BR /&gt;NiFi ValidateCSV: &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.20.0/org.apache.nifi.processors.standard.ValidateCsv/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.20.0/org.apache.nifi.processors.standard.ValidateCsv/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;How To ValidateRecord: &lt;A href="https://community.cloudera.com/t5/Community-Articles/Using-Apache-NiFi-to-Validate-that-Records-Adhere-to-a/ta-p/247299" target="_blank"&gt;https://community.cloudera.com/t5/Community-Articles/Using-Apache-NiFi-to-Validate-that-Records-Adhere-to-a/ta-p/247299&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 06:40:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/reject-invalid-csv-files/m-p/370422#M240732</guid>
      <dc:creator>cotopaul</dc:creator>
      <dc:date>2023-05-10T06:40:38Z</dc:date>
    </item>
  </channel>
</rss>

