title: Creating Hive table on Parquet file which has JSON data
body: <p>The objective I'm trying to achieve</p>
  
  <ol>
  <li>Obtain the data from source big JSON files ( <strong>employee-sample.json</strong>)</li>
  <li>A simple spark application to read it as text file and store in parquet ( <strong>simple-loader.java</strong> ). I'm not aware of what is in JSON file so I cannot put any schema , so I want schema on read, and not schema on write. A parquet file with one column named "value" containing the JSON string in created</li>
  <li>Create an HIVE external table on parquet files, and when I do "select * from table", I see one-column coming out with JSON data.</li>
  </ol>
  
  <p>What I really need is creating a HIVE table which could read the JSON-data in "value" column and apply schema and emit columns, so that I can create variety of tables on my RAW-data, depending on the need.</p>
  
  <p>I have created hive tables on JSON file, and extracted the columns , but this extract column from parquet and apply JSON schema is tricking me</p>
  
  <pre><code>employee-sample.json
  
  {"name":"Dave", "age" : 30 , "DOB":"1987-01-01"}
  {"name":"Steve", "age" : 31 , "DOB":"1986-01-01"}
  {"name":"Kumar", "age" : 32 , "DOB":"1985-01-01"}
  </code></pre>
  
  <p>Simple Spark code to convert JSON to parquet</p>
  
  <pre><code>simple-loader.java
  
  public static void main(String[] args) {
      SparkSession sparkSession = SparkSession.builder()
              .appName(JsonToParquet.class.getName())
              .master("local[*]").getOrCreate();
      Dataset&lt;String&gt; eventsDataSet = sparkSession.read().textFile("D:\\dev\\employee-sample.json");
      eventsDataSet.createOrReplaceTempView("rawView");
      sparkSession.sqlContext().sql("select string(value) as value from rawView")
              .write()
              .parquet("D:\\dev\\" + UUID.randomUUID().toString());
      sparkSession.close();
  }
  </code></pre>
  
  <p>hive table on parquet files</p>
  
  <pre><code>CREATE EXTERNAL TABLE EVENTS_RAW (
  VALUE STRING)
  STORED AS PARQUET
  LOCATION 'hdfs://XXXXXX:8020/employee/data_raw';
  </code></pre>
  
  <p>I tried by setting JSON  serde, but it works only if data is stored in JSON foram, ROW FORMAT SERDE 'com.proofpoint.hive.serde.JsonSerde'</p>
  
  <p>EXPECTED FORMAT</p>
  
  <pre><code>CREATE EXTERNAL TABLE EVENTS_DATA (
      NAME STRING,
      AGE STRING,
      DOB STRING)
  ??????????????????????????????
  </code></pre>