<?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: create hive table from nested json file in NIFI in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/create-hive-table-from-nested-json-file-in-NIFI/m-p/189540#M151633</link>
    <description>&lt;P&gt;For approach #1, you could use the &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.6.0/org.apache.nifi.processors.standard.FlattenJson/index.html" target="_blank"&gt;FlattenJson&lt;/A&gt; processor, you'll likely want to set the Separator property to "_" rather than the default "." since Hive adds the table name to each column in a ResultSet.&lt;/P&gt;&lt;P&gt;For approach #2, you could have a single column table (column of type String), then you'd query it with get_json_object (example &lt;A href="https://www.guru99.com/data-extraction-hive.html" target="_blank"&gt;here&lt;/A&gt;). Alternatively if you can map all the types (including the complex types like array, list, struct, etc.) to a Hive table definition, you could use a JSON SerDe to write the data (example &lt;A href="https://github.com/rcongiu/Hive-JSON-Serde" target="_blank"&gt;here&lt;/A&gt;).&lt;/P&gt;</description>
    <pubDate>Mon, 21 May 2018 21:16:10 GMT</pubDate>
    <dc:creator>mburgess</dc:creator>
    <dc:date>2018-05-21T21:16:10Z</dc:date>
    <item>
      <title>create hive table from nested json file in NIFI</title>
      <link>https://community.cloudera.com/t5/Support-Questions/create-hive-table-from-nested-json-file-in-NIFI/m-p/189538#M151631</link>
      <description>&lt;P&gt;I have a very complex nested JSON file, with atleast six level of nested at some sections.&lt;/P&gt;&lt;P&gt;I am trying to load the nested JSON to HIVE table. Could anyone please help me how to do it???&lt;BR /&gt;&lt;BR /&gt;My approaches:&lt;/P&gt;&lt;P&gt;1. Flatten the nested JSON file and load it(wasn't sure what processors to use in NIFI-trying to use JOLT but I am pretty new to it)&lt;/P&gt;&lt;P&gt;2. Load directly the JSON file to HIVE(without flattening)&lt;/P&gt;&lt;P&gt;Attached sample JSON file &lt;A href="https://community.cloudera.com/legacyfs/online/attachments/72754-nestedjson.txt"&gt;nestedjson.txt&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 May 2018 00:50:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/create-hive-table-from-nested-json-file-in-NIFI/m-p/189538#M151631</guid>
      <dc:creator>tulasi_harishku</dc:creator>
      <dc:date>2018-05-11T00:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: create hive table from nested json file in NIFI</title>
      <link>https://community.cloudera.com/t5/Support-Questions/create-hive-table-from-nested-json-file-in-NIFI/m-p/189539#M151632</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/641/mburgess.html" nodeid="641"&gt;@Matt Burgess&lt;/A&gt;</description>
      <pubDate>Fri, 11 May 2018 01:03:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/create-hive-table-from-nested-json-file-in-NIFI/m-p/189539#M151632</guid>
      <dc:creator>tulasi_harishku</dc:creator>
      <dc:date>2018-05-11T01:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: create hive table from nested json file in NIFI</title>
      <link>https://community.cloudera.com/t5/Support-Questions/create-hive-table-from-nested-json-file-in-NIFI/m-p/189540#M151633</link>
      <description>&lt;P&gt;For approach #1, you could use the &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.6.0/org.apache.nifi.processors.standard.FlattenJson/index.html" target="_blank"&gt;FlattenJson&lt;/A&gt; processor, you'll likely want to set the Separator property to "_" rather than the default "." since Hive adds the table name to each column in a ResultSet.&lt;/P&gt;&lt;P&gt;For approach #2, you could have a single column table (column of type String), then you'd query it with get_json_object (example &lt;A href="https://www.guru99.com/data-extraction-hive.html" target="_blank"&gt;here&lt;/A&gt;). Alternatively if you can map all the types (including the complex types like array, list, struct, etc.) to a Hive table definition, you could use a JSON SerDe to write the data (example &lt;A href="https://github.com/rcongiu/Hive-JSON-Serde" target="_blank"&gt;here&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 21:16:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/create-hive-table-from-nested-json-file-in-NIFI/m-p/189540#M151633</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2018-05-21T21:16:10Z</dc:date>
    </item>
  </channel>
</rss>

