<?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 load data from CSV to mySQL in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Nifi-load-data-from-CSV-to-mySQL/m-p/355869#M237154</link>
    <description>&lt;P&gt;Anyone?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Oct 2022 20:13:59 GMT</pubDate>
    <dc:creator>i_am_dba</dc:creator>
    <dc:date>2022-10-21T20:13:59Z</dc:date>
    <item>
      <title>Nifi load data from CSV to mySQL</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-load-data-from-CSV-to-mySQL/m-p/355593#M237110</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;I am trying to load simple CSV to mySQL but i have some difficulties with NULL and empty string values.&lt;BR /&gt;This is my table for example:&lt;/P&gt;&lt;P class="p1"&gt;&lt;STRONG&gt;create&lt;/STRONG&gt; &lt;STRONG&gt;table&lt;/STRONG&gt;&lt;SPAN class="s1"&gt; test1 (&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;id &lt;SPAN class="s2"&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s3"&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s3"&gt;&lt;STRONG&gt;null&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;name &lt;SPAN class="s2"&gt;&lt;STRONG&gt;varchar&lt;/STRONG&gt;&lt;/SPAN&gt;(&lt;SPAN class="s4"&gt;255&lt;/SPAN&gt;) &lt;SPAN class="s3"&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s3"&gt;&lt;STRONG&gt;null&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P class="p2"&gt;age &lt;SPAN class="s2"&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;&lt;STRONG&gt;null&lt;/STRONG&gt;&lt;/SPAN&gt;)&lt;SPAN class="s5"&gt;;&lt;BR /&gt;&lt;BR /&gt;and my data looks like this in the mySQL:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="i_am_dba_0-1666255157910.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/35986iF29A9DAF6B3D9D42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="i_am_dba_0-1666255157910.png" alt="i_am_dba_0-1666255157910.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;*the blank values are not NULL they were inserted like:&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;insert&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;&lt;STRONG&gt;into&lt;/STRONG&gt;&lt;/SPAN&gt; test(id,name) &lt;SPAN class="s1"&gt;&lt;STRONG&gt;values&lt;/STRONG&gt;&lt;/SPAN&gt; (&lt;SPAN class="s2"&gt;2&lt;/SPAN&gt;,&lt;SPAN class="s3"&gt;''&lt;/SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;Now when I export this into CSV and try to load this CSV back to mySQL it fails to understand that those empty values are just blank and not NULLs.&lt;BR /&gt;This is my NiFi configuration:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="i_am_dba_1-1666255314896.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/35987iB309A01C738E5C8A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="i_am_dba_1-1666255314896.png" alt="i_am_dba_1-1666255314896.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="i_am_dba_2-1666255350704.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/35988i7CAB4E36FA1253D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="i_am_dba_2-1666255350704.png" alt="i_am_dba_2-1666255350704.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I followed the template from another question I found here and removed some parts that I find like I don't need (or maybe I need??) = removed the&amp;nbsp; AvroSchemaRegistry and instead used&amp;nbsp;&lt;SPAN&gt;Use String Fields From Header.&lt;BR /&gt;&lt;BR /&gt;I tried many things from exporting values with double quotes,single quotes but still didn't manage to figure out how to load empty/blank/'' values instead of NULLs.&lt;BR /&gt;&lt;BR /&gt;Please help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 08:45:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-load-data-from-CSV-to-mySQL/m-p/355593#M237110</guid>
      <dc:creator>i_am_dba</dc:creator>
      <dc:date>2022-10-20T08:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi load data from CSV to mySQL</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-load-data-from-CSV-to-mySQL/m-p/355869#M237154</link>
      <description>&lt;P&gt;Anyone?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 20:13:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-load-data-from-CSV-to-mySQL/m-p/355869#M237154</guid>
      <dc:creator>i_am_dba</dc:creator>
      <dc:date>2022-10-21T20:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi load data from CSV to mySQL</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-load-data-from-CSV-to-mySQL/m-p/355967#M237168</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/101288"&gt;@i_am_dba&lt;/a&gt;&amp;nbsp; This is a very difficult one to explain.&amp;nbsp; I think the issue is the string schema, or removing the avro schema you mentioned.&amp;nbsp; My first suggestion would be to try to specific the schema which should help getting the data into the right formats.&amp;nbsp; &amp;nbsp;An alternate solution is to try and do that manually by replacetext/regex,etc but that is not the ideal solution.&amp;nbsp; &amp;nbsp;That said, another higher level suggesting is to update the upstream datasource to permanently solve the instability from '' (blank string), 'null' (string), or actual NULL (not a blank, '', or string at all).&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 13:18:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-load-data-from-CSV-to-mySQL/m-p/355967#M237168</guid>
      <dc:creator>steven-matison</dc:creator>
      <dc:date>2022-10-24T13:18:12Z</dc:date>
    </item>
  </channel>
</rss>

