Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> External table with Avro Serde


Copy link to this message
-
Re: External table with Avro Serde
Fairly sure you just forgot the 'Stored As' clause.

The below works for me on .11

CREATE EXTERNAL TABLE avrotab
PARTITIONED BY(dq_dummy int)
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/user1/avrodata'

TBLPROPERTIES ( 'avro.schema.literal'='{
  "namespace": "com.poweredanalytics.serializer",
  "name": "help_hive_serializer",
  "type": "record",
  "fields": [
    { "name":"dummy", "type":"int" },
    { "name":"other", "type":["int","null"] }
  ] }
')
;

On Sat, Sep 21, 2013 at 9:41 PM, Sravya Tirukkovalur <[EMAIL PROTECTED]>wrote:

> This command fails:
>
> CREATE EXTERNAL TABLE avrotab
> PARTITIONED BY(dummy int)
> LOCATION '/user/user1/avrodata'
> ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
> INPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
> TBLPROPERTIES ( 'avro.schema.url'='file:///tmp/data.avsc');
>
> Error:
> Error: Error while processing statement: FAILED: ParseException line 1:131
> missing EOF at 'ROW' near ''/user/user1/avrodata'' (state=42000,code=40000)
>
> Not sure what I am missing. Can anyone see any obvious mistake?
>
> Thanks!
> --
> Sravya Tirukkovalur
>

--
https://github.com/bearrito
@deepbearrito
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB