Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

how to create and store the avro files in hive table?

Solved Go to solution

Re: how to create and store the avro files in hive table?

Contributor

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.

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.

Highlighted

Re: how to create and store the avro files in hive table?

New Contributor

@Predrag Minovic 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?

Re: how to create and store the avro files in hive table?

Okay, please uplaod your files somewhere (one of your exisiting questions, or a new one), and I'll try to read them with Hive.

Re: how to create and store the avro files in hive table?

New Contributor

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.

Don't have an account?
Coming from Hortonworks? Activate your account here