hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sravya Tirukkovalur <sra...@cloudera.com>
Subject Re: External table with Avro Serde
Date Tue, 24 Sep 2013 06:11:02 GMT
Thank you, that was helpful!


On Sat, Sep 21, 2013 at 7:02 PM, j.barrett Strausser <
j.barrett.strausser@gmail.com> wrote:

> 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 <sravya@cloudera.com>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
>



-- 
Sravya Tirukkovalur

Mime
View raw message