You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Michael Segel <ms...@hotmail.com> on 2015/02/02 14:09:28 UTC

Simple way to export data from a Hive table in to Avro?

Currently using Hive 13.x

Would like to select from a table that exists and output to an external file(s) in avro via hive. 

Is there a simple way to do this? 

From what I’ve seen online, the docs tend to imply you need to know the avro schema when you specify the table. 
Could you copy from an existing table, or do I need to dump the current schema and write some code to generate an avro schema? 

Thx

-Mike


Re: Simple way to export data from a Hive table in to Avro?

Posted by Daniel Haviv <da...@veracity-group.com>.
I might be missing something here but you could use:
Create table newtable stored as avro as select * from oldtable

On Mon, Feb 2, 2015 at 3:09 PM, Michael Segel <ms...@hotmail.com>
wrote:

> Currently using Hive 13.x
>
> Would like to select from a table that exists and output to an external
> file(s) in avro via hive.
>
> Is there a simple way to do this?
>
> From what I’ve seen online, the docs tend to imply you need to know the
> avro schema when you specify the table.
> Could you copy from an existing table, or do I need to dump the current
> schema and write some code to generate an avro schema?
>
> Thx
>
> -Mike
>
>