<?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 create and store the avro files in hive table? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139649#M102274</link>
    <description>&lt;P&gt;i was trying to create hive table for storing avro file and i have stored my avro shema(.avsc file),my avro file in single location.&lt;/P&gt;&lt;P&gt;could anyone  help me to create the table in hive?&lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2016 14:51:10 GMT</pubDate>
    <dc:creator>Manikandan_a</dc:creator>
    <dc:date>2016-05-10T14:51:10Z</dc:date>
    <item>
      <title>how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139649#M102274</link>
      <description>&lt;P&gt;i was trying to create hive table for storing avro file and i have stored my avro shema(.avsc file),my avro file in single location.&lt;/P&gt;&lt;P&gt;could anyone  help me to create the table in hive?&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 14:51:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139649#M102274</guid>
      <dc:creator>Manikandan_a</dc:creator>
      <dc:date>2016-05-10T14:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139650#M102275</link>
      <description>&lt;P&gt;Hi &lt;A href="https://community.hortonworks.com/questions/32385/how-to-create-and-store-the-avro-files-in-hive-tab.html#"&gt;@manikandan ayyasamy&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Have you looked to the Hive doc on AvroSerDe : &lt;A href="https://cwiki.apache.org/confluence/display/Hive/AvroSerDe" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/AvroSerDe&lt;/A&gt; ? you have examples on how to do it following your Hive version.&lt;/P&gt;&lt;P&gt;Please try to implement it and ask the community if you have a particular problem with your approach.&lt;/P&gt;&lt;P&gt;Note also that ORC can give the best performance with cost base optimization and Vectorization. Give it a try if this is a viable option.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 16:24:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139650#M102275</guid>
      <dc:creator>ahadjidj</dc:creator>
      <dc:date>2016-05-10T16:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139651#M102276</link>
      <description>&lt;P&gt;If you already have your Avro file and Avro schema, upload them to HDFS and use&lt;/P&gt;&lt;PRE&gt;CREATE EXTERNAL TABLE my_avro_tbl
  ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
  STORED as INPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
  OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
  LOCATION '/user/...'
  TBLPROPERTIES ('avro.schema.url'='hdfs://name-node.fqdn:8020/user/.../schema.avsc');
&lt;/PRE&gt;&lt;P&gt;If your Avro file already contains the schema in its header you can just say &lt;/P&gt;&lt;PRE&gt;CREATE EXTERNAL TABLE tbl-name(... declarations ...) STORED AS AVRO LOCATION '...';&lt;/PRE&gt;&lt;P&gt;without specifying the schema. I have been testing it last few days and can confirm that it works on HDP-2.4 (Hive-1.2) for all scalar types like string, int, float, double, boolean etc. If you are using some complex types (like union) it might not work. &lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 18:08:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139651#M102276</guid>
      <dc:creator>pminovic</dc:creator>
      <dc:date>2016-05-10T18:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139652#M102277</link>
      <description>&lt;P&gt;i have tried the following,but i am not able to create the table.&lt;/P&gt;&lt;P&gt;create external table tweets(name string,time int,tweet string)
ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.AvroSerDe' &lt;/P&gt;&lt;P&gt;  STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat' &lt;/P&gt;&lt;P&gt;  OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat' &lt;/P&gt;&lt;P&gt;  TBLPROPERTIES (
    'avro.schema.url'='http://trvlhaddv2gw1.tsh.thomson.com:8888/filebrowser/view/user/c400351/tweet.avsc');&lt;/P&gt;&lt;P&gt;i did not get any error messages.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 20:49:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139652#M102277</guid>
      <dc:creator>Manikandan_a</dc:creator>
      <dc:date>2016-05-10T20:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139653#M102278</link>
      <description>&lt;P&gt;What's the problem you are facing If you didn't get any error messages ? can you see the table tweets when you do :&lt;/P&gt;&lt;PRE&gt;show tables;
&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 May 2016 20:56:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139653#M102278</guid>
      <dc:creator>ahadjidj</dc:creator>
      <dc:date>2016-05-10T20:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139654#M102279</link>
      <description>&lt;P&gt;You are missing the "LOCATION" for your external table. Uplaod your Avro file somewhere in HDFS and provide the directory where your Avro file is located as your LOCATION. There is also no need to declare name, time etc., they are given in your avsc file. See my answer. After that try "SELECT * FROM tweets LIMIT 10;".&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 21:23:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139654#M102279</guid>
      <dc:creator>pminovic</dc:creator>
      <dc:date>2016-05-10T21:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139655#M102280</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/177/pminovic.html" nodeid="177"&gt;@Predrag Minovic&lt;/A&gt; So I've been battling with Avro and Hive for days and am getting nowhere. See thread &lt;A href="https://community.hortonworks.com/questions/32034/avro-javaioioexception-javaioioexception-not-a-dat.html#answer-32060"&gt;here&lt;/A&gt; and &lt;A href="https://community.hortonworks.com/questions/31896/unable-to-access-avro-object-in-hbase-from-hive.html"&gt;here&lt;/A&gt;. If you can shed any light, it would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 21:37:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139655#M102280</guid>
      <dc:creator>markdoutre</dc:creator>
      <dc:date>2016-05-10T21:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139656#M102281</link>
      <description>&lt;P&gt;Mark, here is what I did: Having a csv file as an input I created a Hive text table, loaded csv file onto the text table, created an Avro table "STORED AS AVRO", and inserted all recored from the text table into the avro table. I also tried to create an Avro table using a schema file. Then I tested external tables using avro table data and scheme file. I'll create an article and post this week.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 21:48:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139656#M102281</guid>
      <dc:creator>pminovic</dc:creator>
      <dc:date>2016-05-10T21:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139657#M102282</link>
      <description>&lt;P&gt;The issue I am having is that I have avro objects that don't have the schema in the header. When I try and access these objects by specifying the schema via the schema.url parameter in the TBLPROPERTIES I am unable to access the data. However, if the Avro object includes the schema, I have no problem. &lt;/P&gt;&lt;P&gt;I'm pretty sure that the Avro objects are ok as I can extract the data from them using Avro-tools and providing the same schema. So what I would be interesting in seeing is if someone can load a schema-less avro object into HDFS then get a Hive table to access it, by providing the schema file.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 21:54:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139657#M102282</guid>
      <dc:creator>markdoutre</dc:creator>
      <dc:date>2016-05-10T21:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139658#M102283</link>
      <description>&lt;P&gt;Okay, please uplaod your files somewhere (one of your exisiting questions, or a new one), and I'll try to read them with Hive.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 22:03:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139658#M102283</guid>
      <dc:creator>pminovic</dc:creator>
      <dc:date>2016-05-10T22:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139659#M102284</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/9696/arunmani333.html" nodeid="9696"&gt;@manikandan ayyasamy&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Ok, from reading your several posts and comments I think that Hive is not able to access your schema on HDFS. I see that you are trying to give the schema that's stored on HDFS. However, you are using http and port 8888 which is not good. Can you try with this modification&lt;/P&gt;&lt;PRE&gt;TBLPROPERTIES ('avro.schema.url'='hdfs://trvlhaddv2gw1.tsh.thomson.com:8020/PATH_TO_YOUR_AVSC_FILE');
&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 May 2016 23:26:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139659#M102284</guid>
      <dc:creator>ahadjidj</dc:creator>
      <dc:date>2016-05-10T23:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139660#M102285</link>
      <description>&lt;P&gt;Hi Mani,&lt;/P&gt;&lt;P&gt;Below are my observations&lt;/P&gt;&lt;P&gt;1. specifying schema in your DDL and also the Avro schema. i.e column names as part of DDL and Avro URL. use only one.&lt;/P&gt;&lt;P&gt;2. Is the schema in provided URL accessible from HDFS? you can move it HDFS and test&lt;/P&gt;&lt;P&gt;3. The serde is pointing to hcatalog, try using &lt;STRONG&gt;org.apache.hadoop.hive.serde2.avro.AvroSerDe&lt;/STRONG&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 00:11:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139660#M102285</guid>
      <dc:creator>2hanu_valluri</dc:creator>
      <dc:date>2016-10-21T00:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139661#M102286</link>
      <description>&lt;P&gt;When you say declarations above, you mean actually defining the columns and datatypes? What is the syntax for that? I am writing hdfs files from NiFi so it stores the schema header in the Avro file. I want to leverage that to create the hive table but do not have any good example to do that. If you could elaboratethe declarations part with some examples of a few columns it would really help.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 15:31:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139661#M102286</guid>
      <dc:creator>vinod_h_chhabri</dc:creator>
      <dc:date>2016-12-08T15:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to create and store the avro files in hive table?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139662#M102287</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/177/pminovic.html" nodeid="177"&gt;@Predrag Minovic&lt;/A&gt; could you please let me know how did you created hive avro table from hive text table? did you select from text table and created avro table using CREATE AS SELECT?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 20:02:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-create-and-store-the-avro-files-in-hive-table/m-p/139662#M102287</guid>
      <dc:creator>sancar_sn</dc:creator>
      <dc:date>2017-11-06T20:02:18Z</dc:date>
    </item>
  </channel>
</rss>

