hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sachin Goyal <>
Subject Re: How to query UNION types in Hive with Avro
Date Mon, 11 Aug 2014 19:56:57 GMT
Thanks Vikas,

I did see the below URL before posting but it is not clear to me how I run a select query.

For example, if the union ‘x’ is:
Then how do I run the query:
         select x.a from tbl;


From: hadoop hive <<>>
Reply-To: "<>" <<>>
Date: Monday, August 11, 2014 at 12:14 PM
To: "<>" <<>>
Subject: Re: How to query UNION types in Hive with Avro

Hi Sachin,

Here is the doc from hwk, this might help you.

Vikas Srivastava

On Aug 12, 2014 12:31 AM, "Sachin Goyal" <<>>

I am using Hive and Avro with union types as follows:

hive> desc tbl1;

productid         uniontype<void,struct<productid:string,itemid:bigint>,struct<circularrefid:int>>
from deserializer

hive> select productid from tbl1;


hive> select productid.productid from tbl1

FAILED: SemanticException [Error 10042]: Line 1:7 . Operator is only supported on struct or
list of struct types 'productid'

Does anyone know how to use the union-types inside a select query?



View raw message