<?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 Malformed Data.Length is negative in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223181#M79614</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/83389/hai-pbk.html" nodeid="83389" target="_blank"&gt;@Bal P&lt;/A&gt;&lt;P&gt;Try with &lt;STRONG&gt;Schema Access Strategy&lt;/STRONG&gt; as &lt;STRONG&gt;Embedded Avro Schema&lt;/STRONG&gt; in AvroReader and &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Schema Access Strategy &lt;/STRONG&gt;&lt;STRONG&gt;Inherit Record Schema  &lt;/STRONG&gt;in CsvrecordSetWriter controller services&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avro Reader:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="78468-schema-access.png" style="width: 1562px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15621i1B96182E8D1C8314/image-size/medium?v=v2&amp;amp;px=400" role="button" title="78468-schema-access.png" alt="78468-schema-access.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CsvSetwriter:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="78469-csvsetwriter.png" style="width: 1509px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15622iEDB29A0B903BA77D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="78469-csvsetwriter.png" alt="78469-csvsetwriter.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;With the above configs i'm able to get the output flowfile in csv format as shown below.&lt;/P&gt;&lt;PRE&gt;empno,name,deptno,age,sal
10,abcadefshnz,100,20,12700.5&lt;/PRE&gt;</description>
    <pubDate>Sun, 18 Aug 2019 01:58:18 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T01:58:18Z</dc:date>
    <item>
      <title>NIFI Malformed Data.Length is negative</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223178#M79611</link>
      <description>&lt;P&gt;I am new to NIFI learning how each processor works....&lt;/P&gt;&lt;P&gt;I am trying to generate CSV file extracting some   from Database, following are sequence of processors i am using to achive this&lt;/P&gt;&lt;P&gt;ExecuteSQL -&amp;gt; Execute a simple query (select empno,name,deptno,age,sal from emp limit 1 )  -- Working perfectly fine&lt;/P&gt;&lt;P&gt;UpdateAttribute  -&amp;gt; Added a new property "schema.name"= emp  -- Working perfectly fine&lt;/P&gt;&lt;P&gt;Convert Record -&amp;gt;   Getting Error here &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;RecordReader - AVROReader&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;RecordWriter - CSVRecordSetWriter &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&lt;STRONG&gt;AVROSchemaRegistry:&lt;/STRONG&gt; &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;{
"name":"emp",
"namespace":"nifi",
"type":"record",
"fields":
[ 
{"name": "empno" , "type":"int"},
{"name":  "name", "type":"string"},
{"name": "deptno", "type":"int"},
{"name":  "age", "type":"int"},
{"name":  "sal", "type":"float"}
]
}&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&lt;STRONG&gt;Data In Queue before failure processor:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;[ {
  "empno" : 10,
  "name" : "abcadefshnz",
  "deptno" : 100,
  "age" : 20,
  "sal" : 12700.5
} ]&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;ErrorMessage : &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;failed to process session due to org.apache.avro.AvroRuntimeException: Malformed data. Length is negative: -51; Processor Administratively Yielded for 1 sec: org.apache.avro.AvroRuntimeException: Malformed data. Length is negative: -51
org.apache.avro.AvroRuntimeException: Malformed data. Length is negative: -51&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;Thanks in advance...&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 22:09:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223178#M79611</guid>
      <dc:creator>hai_pbk</dc:creator>
      <dc:date>2018-06-15T22:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI Malformed Data.Length is negative</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223179#M79612</link>
      <description>&lt;P&gt;Please show the configuration of your AvroReader, specifically how the schema access strategy is configured.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 19:50:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223179#M79612</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2018-06-16T19:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI Malformed Data.Length is negative</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223180#M79613</link>
      <description>&lt;P&gt;Here are the screenshots &lt;A href="https://community.cloudera.com/legacyfs/online/attachments/77687-avroreader.jpg"&gt;avroreader.jpg&lt;/A&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/77688-csvrecordsetwriter.jpg"&gt;csvrecordsetwriter.jpg&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 01:32:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223180#M79613</guid>
      <dc:creator>hai_pbk</dc:creator>
      <dc:date>2018-06-17T01:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI Malformed Data.Length is negative</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223181#M79614</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/83389/hai-pbk.html" nodeid="83389" target="_blank"&gt;@Bal P&lt;/A&gt;&lt;P&gt;Try with &lt;STRONG&gt;Schema Access Strategy&lt;/STRONG&gt; as &lt;STRONG&gt;Embedded Avro Schema&lt;/STRONG&gt; in AvroReader and &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Schema Access Strategy &lt;/STRONG&gt;&lt;STRONG&gt;Inherit Record Schema  &lt;/STRONG&gt;in CsvrecordSetWriter controller services&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avro Reader:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="78468-schema-access.png" style="width: 1562px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15621i1B96182E8D1C8314/image-size/medium?v=v2&amp;amp;px=400" role="button" title="78468-schema-access.png" alt="78468-schema-access.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CsvSetwriter:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="78469-csvsetwriter.png" style="width: 1509px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15622iEDB29A0B903BA77D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="78469-csvsetwriter.png" alt="78469-csvsetwriter.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;With the above configs i'm able to get the output flowfile in csv format as shown below.&lt;/P&gt;&lt;PRE&gt;empno,name,deptno,age,sal
10,abcadefshnz,100,20,12700.5&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Aug 2019 01:58:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223181#M79614</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T01:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI Malformed Data.Length is negative</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223182#M79615</link>
      <description>&lt;P&gt;Thanks Shu, it is working fine, does this mean SchemaRegistry  setup is not required ??&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 03:44:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223182#M79615</guid>
      <dc:creator>hai_pbk</dc:creator>
      <dc:date>2018-06-17T03:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI Malformed Data.Length is negative</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223183#M79616</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/83389/hai-pbk.html" nodeid="83389"&gt;@Bal P&lt;/A&gt;&lt;P&gt;For avro data file schema will be embedded and you want to write all the fields in CSV format so we don't need to setup the registry. if you are writing only specific columns not all and for other formats JSON.. then schema registry is required &lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 04:37:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Malformed-Data-Length-is-negative/m-p/223183#M79616</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-06-17T04:37:37Z</dc:date>
    </item>
  </channel>
</rss>

