<?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: Trouble converting JSON to AVRO in Nifi in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202591#M65817</link>
    <description>&lt;P&gt;The incoming JSON you showed does not match your schema... &lt;/P&gt;&lt;P&gt;Your schema above shows that there is a single record with the fields "businessentityid", "accountnumber", "name", "creditrating".&lt;/P&gt;&lt;P&gt;Your incoming JSON shows a field named "fields" with an array of JSON documents where each JSON document then has the four fields.&lt;/P&gt;&lt;P&gt;If you want to make a schema that matches that JSON, your schema needs to declare a field called "fields" of type array, where each entry of the array is a type record with the four fields.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jul 2017 23:04:14 GMT</pubDate>
    <dc:creator>bbende</dc:creator>
    <dc:date>2017-07-31T23:04:14Z</dc:date>
    <item>
      <title>Trouble converting JSON to AVRO in Nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202590#M65816</link>
      <description>&lt;P&gt;I'm trying to ingest JSON data and store it in AVRO format for consumption downstream.  I'm using the ConvertJSONToAvro processor (1.3).  The data is coming out of the processor as successful, but there is no data.&lt;/P&gt;&lt;P&gt;Here is the incoming JSON&lt;/P&gt;&lt;PRE&gt;{
  "type" : "record",
  "name" : "vendor",
  "fields" : [ {
    "businessentityid" : 1518,
    "accountnumber" : "INTERNAT0004",
    "name" : "International Trek Center",
    "creditrating" : 1
  }, {
    "businessentityid" : 1520,
    "accountnumber" : "G&amp;amp;KBI0001",
    "name" : "G &amp;amp; K Bicycle Corp.",
    "creditrating" : 1
  }, {
    "businessentityid" : 1546,
    "accountnumber" : "GREENLA0001",
    "name" : "Green Lake Bike Company",
    "creditrating" : 1
  }, {
    "businessentityid" : 1574,
    "accountnumber" : "JEFFSSP0001",
    "name" : "Jeff's Sporting Goods",
    "creditrating" : 1
  }, {
    "businessentityid" : 1594,
    "accountnumber" : "FITNESS0001",
    "name" : "Fitness Association",
    "creditrating" : 1
  }, {
    "businessentityid" : 1636,
    "accountnumber" : "INTEGRAT0001",
    "name" : "Integrated Sport Products",
    "creditrating" : 1
  }, {
    "businessentityid" : 1676,
    "accountnumber" : "TEAMATH0001",
    "name" : "Team Athletic Co.",
    "creditrating" : 1
  } ]
}
&lt;/PRE&gt;&lt;P&gt;Here is the AVRO schema&lt;/P&gt;&lt;PRE&gt;{
		"type":"${schema.type}",
		"name":"${schema.name}",
		"fields":
		[
			{
				"name":"businessentityid",
				"type":["int","null"]
			},
			{
				"name":"accountnumber",
				"type":["string","null"]
			},
			{
				"name":"name",
				"type":["string","null"]
			},
			{
				"name":"creditrating",
				"type":["int","null"]
			}
		]
}	
&lt;/PRE&gt;&lt;P&gt;Here is the JSON output, after converting it back to JSON.&lt;/P&gt;&lt;PRE&gt;{
  "businessentityid" : null,
  "accountnumber" : null,
  "name" : "vendor",
  "creditrating" : null
}
&lt;/PRE&gt;&lt;P&gt;Any assistance is greatly appreciated.  BTW, trying to turn up the logging to anything other than INFO in Nifi has not yielded any different logging behavior.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;M &lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 22:04:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202590#M65816</guid>
      <dc:creator>mvogt99</dc:creator>
      <dc:date>2017-07-31T22:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble converting JSON to AVRO in Nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202591#M65817</link>
      <description>&lt;P&gt;The incoming JSON you showed does not match your schema... &lt;/P&gt;&lt;P&gt;Your schema above shows that there is a single record with the fields "businessentityid", "accountnumber", "name", "creditrating".&lt;/P&gt;&lt;P&gt;Your incoming JSON shows a field named "fields" with an array of JSON documents where each JSON document then has the four fields.&lt;/P&gt;&lt;P&gt;If you want to make a schema that matches that JSON, your schema needs to declare a field called "fields" of type array, where each entry of the array is a type record with the four fields.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 23:04:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202591#M65817</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2017-07-31T23:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble converting JSON to AVRO in Nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202592#M65818</link>
      <description>&lt;P&gt;So the schema should look something like? ...&lt;/P&gt;&lt;PRE&gt;{
		"type":"record",
		"name":"vendor",
		"fields":
		[
			"name":"children",
			"type":
			{
				"type":"array",
				"items":
				{
					"name":"Child",
					"type":"record",
					"fields":
					[
						{
							"name":"businessentityid",
							"type":["int","null"]
						},
						{
							"name":"accountnumber",
							"type":["string","null"]
						},
						{
							"name":"name",
							"type":["string","null"]
						},
						{
							"name":"creditrating",
							"type":["int","null"]
						}
					]
				}
			}
		]
}	

&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2017 00:50:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202592#M65818</guid>
      <dc:creator>mvogt99</dc:creator>
      <dc:date>2017-08-01T00:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble converting JSON to AVRO in Nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202593#M65819</link>
      <description>&lt;P&gt;That looks close... where you have "name" : "children"  it seems like that should be "name" : "fields" since "fields" is the array element in your JSON.&lt;/P&gt;&lt;P&gt;Your example JSON also has top-level fields for "type" and "name" so I would think you want to declare those in the schema, unless you just want to skip over them.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 00:54:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202593#M65819</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2017-08-01T00:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble converting JSON to AVRO in Nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202594#M65820</link>
      <description>&lt;P&gt;Hmm, the following schema doesn't validate.  Any ideas?&lt;/P&gt;&lt;PRE&gt;{
		"type":"record",
		"name":"vendors",
		"fields":
		[
			"name":"fields",
			"type":
			{
				"type":"array",
				"items":
				{
					"name":"vendor",
					"type":"record",
					"fields":
					[
						{
							"name":"businessentityid",
							"type":["int","null"]
						},
						{
							"name":"accountnumber",
							"type":["string","null"]
						},
						{
							"name":"name",
							"type":["string","null"]
						},
						{
							"name":"creditrating",
							"type":["int","null"]
						}
					]
				}
			}
		]
}
&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2017 01:34:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202594#M65820</guid>
      <dc:creator>mvogt99</dc:creator>
      <dc:date>2017-08-01T01:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble converting JSON to AVRO in Nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202595#M65821</link>
      <description>&lt;P&gt;Thanks for your help.  Finally figured out the Nifi JSONToAvro processor can only accept 1 row at a time, versus an array of rows.  The following worked for me:  &amp;lt;Json array containing multiple rows of data&amp;gt; --&amp;gt; SplitJson --&amp;gt; ConvertJSONToAvro --&amp;gt; MergeContent ... &lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 03:41:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/202595#M65821</guid>
      <dc:creator>mvogt99</dc:creator>
      <dc:date>2017-08-01T03:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble converting JSON to AVRO in Nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/359096#M65822</link>
      <description>&lt;P&gt;Can u please help me...while converting json to avro format,in avro data logical type is not coming&lt;/P&gt;&lt;P&gt;...need to add anything in json&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 06:27:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/359096#M65822</guid>
      <dc:creator>Avrotojson</dc:creator>
      <dc:date>2022-12-08T06:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble converting JSON to AVRO in Nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/359168#M65823</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/102317"&gt;@Avrotojson&lt;/a&gt;,&amp;nbsp;as this is an older post, you would have a better chance of receiving a resolution by&lt;A href="“https://community.cloudera.com/t5/forums/postpage/board-id/Questions”" target="_blank"&gt; starting a new thread&lt;/A&gt;. This will also be an opportunity to provide details specific to your environment that could aid others in assisting you with a more accurate answer to your question. You can link this thread as a reference in your new post.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 06:55:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trouble-converting-JSON-to-AVRO-in-Nifi/m-p/359168#M65823</guid>
      <dc:creator>VidyaSargur</dc:creator>
      <dc:date>2022-12-09T06:55:01Z</dc:date>
    </item>
  </channel>
</rss>

