<?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 How to store and query a flat file containing JSON string as a part of each line, into a hive table ? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-store-and-query-a-flat-file-containing-JSON-string-as/m-p/158196#M36500</link>
    <description>&lt;P&gt;I put into a string field in hive table and query it using get_json_object. That works for me.&lt;/P&gt;&lt;P&gt;But i have another set of data in HDFS like.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1023,UK,{"cities":{"city1":"London","city2":"Birmingham","city3":"Liverpool"},"universities":{"universities1":"Cambridge","universities2":"Oxford"}},07-30-2016&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So i want to store it in a hive table with schema like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table data (SerNo int, country string , detail string,date string )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then what should be the table definition so that {"cities: ..... } 
will come as one column and rest with other ? what should be the column 
separator ?&lt;/P&gt;&lt;P&gt;If i put everything as one string field in hive table , then how i query &lt;STRONG&gt;SerNo&lt;/STRONG&gt; ,&lt;STRONG&gt;country &lt;/STRONG&gt;and&lt;STRONG&gt; date&lt;/STRONG&gt; column. Is it possible by get_json_object ?&lt;/P&gt;</description>
    <pubDate>Sun, 31 Jul 2016 22:51:53 GMT</pubDate>
    <dc:creator>PapuRay</dc:creator>
    <dc:date>2016-07-31T22:51:53Z</dc:date>
    <item>
      <title>How to store and query a flat file containing JSON string as a part of each line, into a hive table ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-store-and-query-a-flat-file-containing-JSON-string-as/m-p/158196#M36500</link>
      <description>&lt;P&gt;I put into a string field in hive table and query it using get_json_object. That works for me.&lt;/P&gt;&lt;P&gt;But i have another set of data in HDFS like.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1023,UK,{"cities":{"city1":"London","city2":"Birmingham","city3":"Liverpool"},"universities":{"universities1":"Cambridge","universities2":"Oxford"}},07-30-2016&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So i want to store it in a hive table with schema like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table data (SerNo int, country string , detail string,date string )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then what should be the table definition so that {"cities: ..... } 
will come as one column and rest with other ? what should be the column 
separator ?&lt;/P&gt;&lt;P&gt;If i put everything as one string field in hive table , then how i query &lt;STRONG&gt;SerNo&lt;/STRONG&gt; ,&lt;STRONG&gt;country &lt;/STRONG&gt;and&lt;STRONG&gt; date&lt;/STRONG&gt; column. Is it possible by get_json_object ?&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2016 22:51:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-store-and-query-a-flat-file-containing-JSON-string-as/m-p/158196#M36500</guid>
      <dc:creator>PapuRay</dc:creator>
      <dc:date>2016-07-31T22:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to store and query a flat file containing JSON string as a part of each line, into a hive table ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-store-and-query-a-flat-file-containing-JSON-string-as/m-p/158197#M36501</link>
      <description>&lt;P&gt;Have you explored json serde - &lt;A href="https://github.com/rcongiu/Hive-JSON-Serde" target="_blank"&gt;https://github.com/rcongiu/Hive-JSON-Serde&lt;/A&gt; ??&lt;/P&gt;&lt;P&gt;I would write a utility script that will convert your dataset to json (inclusive of serNo, Country, cities, date) and then load them into hive using json serde&lt;/P&gt;&lt;P&gt;For more details on Hive Serde, refer to &lt;A href="https://cwiki.apache.org/confluence/display/Hive/DeveloperGuide#DeveloperGuide-HiveSerDe" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/DeveloperGuide#DeveloperGuide-HiveSerDe&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 00:09:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-store-and-query-a-flat-file-containing-JSON-string-as/m-p/158197#M36501</guid>
      <dc:creator>hduraiswamy</dc:creator>
      <dc:date>2016-08-01T00:09:16Z</dc:date>
    </item>
  </channel>
</rss>

