title: Need Help infering an avro schema for a json file in NiFi
body: <p>I am trying to create a flow in NiFi that takes a valid json file and puts it directly into a hive table using the PutHiveStreaming processor. My json looks something like the following:</p>
  
  <pre><code>{
  "Raw_Json": {
      "SystemInfo": {
          "Id": "a string ID",
          "TM": null,
          "CountID": "a string ID",
          "Topic": null,
          "AccountID": "some number",
          "StationID": "some number",
          "STime": "some Timestamp",
          "ETime": "some Timestamp"
      },
      "Profile": {
          "ID": "ID number",
          "ProductID": "Some Number",
          "City": "City Name",
          "State": "State Name",
          "Number": "XXX-XXX-XXXX",
          "ExtNumber": null,
          "Unit": null,
          "Name": "Person Name",
          "Service": "Purchase",
          "AddrID": "00000000",
          "Products": {
              "Product": [{
                  "Code": "CODE",
                  "Description": "some description"
  
              },
              {
                  "Code": "CODE",
                  "Description": "some description"
  
              },
              {
                  "Code": "CODE",
                  "Description": "some description"
  
              },
              {
                  "Code": "CODE",
                  "Description": "some description"
  
              },
              {
                  "Code": "CODE",
                  "Description": "some description"
  
              },
              {
                  "Code": "CODE",
                  "Description": "some description"
  
              },
              {
                  "Code": "CODE",
                  "Description": "some description"
  
              },
              {
                  "Code": "CODE",
                  "Description": "some description"
  
              },
              {
                  "Code": "CODE",
                  "Description": "some description"
  
              },
              {
                  "Code": "CODE",
                  "Description": "some description"
              }]
          }
      },
      "Total": {
          "Amount": "some amount",
          "Delivery": "some address",
          "Estimate": "some amount",
          "Tax": null,
          "Delivery_Type": null
  
      }
  
  },
  "partition_date":"2017-05-19"
  </code></pre>
  
  <p>}</p>
  
  <p>I am getting the json, using the InferAvroSchema processor and from there converting the json to avro format by using the inferred avro schema and sending it into the PutHiveStreaming processor. My Flow looks something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/djk46.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/djk46.jpg" alt=""></a></p>
  
  <p>The main goal is that I want all of the "Raw_Json" column to be dumped into one column in the hive table and the table will be partitioned by the "partition_date" column which will be the second column of the table. The problem is that for some reason NiFi is having problems inferring the nested json from the "Raw_Json" column and is dumping it like Null on the table as shown below:</p>
  
  <p><a href="https://i.stack.imgur.com/gBlDl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gBlDl.jpg" alt=""></a></p>
  
  <p>Does anyone know how could I make NiFi read the entire nested Json of the "Raw_Json" column as one column and send it to the hive table? How could I create my own avro schema for it to do this? Any insight or ideas on how to fix this issue would be greatly appreciated!</p>