<?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 Convert Hive Column type String to Hive Column type struct in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Convert-Hive-Column-type-String-to-Hive-Column-type-struct/m-p/242787#M204586</link>
    <description>&lt;P&gt;Dear community I have executed a SELECT * to fetch all the tables from a hive table using Nifi 1.6 SelectHiveQL processor. &lt;/P&gt;&lt;P&gt;The problem I have is the source table has a column (satellite_metadata) which is type struct&amp;lt;record_source:string,load_time:timestamp,checksum:string,device_hash:string&amp;gt;).&lt;/P&gt;&lt;P&gt;However in the flowfile returned by SelectHiveQL the type of  column satellite_metadata is string.&lt;/P&gt;&lt;P&gt;After fetching the data, I am converting AVRO to ORC, storing the file in HDFS, extracting the HIVE DDL from the flowfile and creating the hive table.&lt;/P&gt;&lt;P&gt;The content of column satellite_metadata for a single record looks like this:&lt;/P&gt;&lt;PRE&gt;{"record_source":"RAB","load_time":"2019-01-18 03:16:26.93","checksum":"11396be4b6cfe13542d3d6708546a4a4","device_hash":"2eac97fce07480194301e482680fe05e"}&lt;/PRE&gt;&lt;P&gt;I tried to define the correct structure at CREATE TABLE and also afterwards using ALTER TABLE But I get the following error when I try to do SELECT * &lt;/P&gt;&lt;PRE&gt;ORC does not support type conversion from file type string (14) to reader type struct&lt;/PRE&gt;&lt;P&gt;Any ideas how can I set the proper type for this struct column?&lt;/P&gt;&lt;P&gt;I've tried also to store the avro file in HDFS, but later I don't know how to create an external hive table that can read the schema from the .avro file.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jan 2019 18:23:25 GMT</pubDate>
    <dc:creator>mariano_billing</dc:creator>
    <dc:date>2019-01-23T18:23:25Z</dc:date>
  </channel>
</rss>

