Hi Roberto,
Yes, your JsonSerde was the one I got working last night. My next question is, 
do you know of any way to have the Hive Table schema statement (e.g. user_id 
bigint, details struct<request_type: int, more_details: struct<id :bigint>> )  
generated or imported if I have the Thrift definitions?

Since Thrift & Hive are both Facebook originated, I am hoping there would be a 
import mechanism that I am yet to discover.
 
-Ayon
See My Photos on Flickr
Also check out my Blog for answers to commonly asked questions.



________________________________
From: Roberto Congiu <roberto.con...@openx.com>
To: user@hive.apache.org; Ayon Sinha <ayonsi...@yahoo.com>
Sent: Friday, July 29, 2011 10:21 AM
Subject: Re: JsonSerde usage help


I think the struct for a struct is correct (you can see in 
ObjectInspectorUtils.getStandardStructTypeName() how it is built).

If you're using this 
serde: http://code.google.com/p/hive-json-serde/source/browse/trunk/src/org/apache/hadoop/hive/contrib/serde2/JsonSerde.java,
 it just doesn't support structs.

Try the one I wrote here (compiled binary under 
'downloads'): https://github.com/rcongiu/Hive-JSON-Serde

it does support structs, even nested like yours.
R.

On Thu, Jul 28, 2011 at 11:59 PM, Ayon Sinha <ayonsi...@yahoo.com> wrote:

Hi All,
>I can't find any reasonable documentation about being able to use Serde's.
>I have a JSONSerde which I use to create an external table
>create external table scratch.json_serde_test (user_id bigint, details 
>struct<request_type: int, more_details: struct<id :bigint> > ) row format 
>serde 'org.apache.hadoop.hive.contrib.serde2.JsonSerde' location 
>'/user/ayon/jsonserde_test';
>
>
>I can't get any select query to work. What is the syntax for select inside a 
>struct?
> 
>-Ayon
>See My Photos on Flickr
>Also check out my Blog for answers to commonly asked questions.
>

Reply via email to