You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Buntu Dev <bu...@gmail.com> on 2015/02/24 19:43:50 UTC

Querying Uniontype with Hive

Hi,

This might've been asked previously but I couldn't find any examples of how
to query uniontype in Hive.

I have this field in the table:

`location`
uniontype<struct<latitude:string,longitude:string,country_short:string,country_long:string,region:string,city:string>,boolean>

How do I go about querying: "select location.latitiude, location.latitude
from ..." since I get this error:

. Operator is only supported on struct or list of struct types


If this is currently not supported via Hive, would appreciate if anyone can
throw some light on how to go about this outside of Hive?


Thanks!

Re: Querying Uniontype with Hive

Posted by Buntu Dev <bu...@gmail.com>.
Still trying to figure out if there is any way to query directly or if
there is any existing UDF to help query union type fields in HiveQL.

Thanks!

On Tue, Feb 24, 2015 at 10:43 AM, Buntu Dev <bu...@gmail.com> wrote:

> Hi,
>
> This might've been asked previously but I couldn't find any examples of
> how to query uniontype in Hive.
>
> I have this field in the table:
>
> `location`
> uniontype<struct<latitude:string,longitude:string,country_short:string,country_long:string,region:string,city:string>,boolean>
>
> How do I go about querying: "select location.latitiude, location.latitude
> from ..." since I get this error:
>
> . Operator is only supported on struct or list of struct types
>
>
> If this is currently not supported via Hive, would appreciate if anyone
> can throw some light on how to go about this outside of Hive?
>
>
> Thanks!
>