You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Rakesh Setty <se...@yahoo-inc.com> on 2009/07/01 22:19:41 UTC

How to store list of maps?

Hi,

            I need to store a list of maps as one of the fields of a record. The documentation suggests that arrays are supported only for primitive data types. Is there any way to do this in Hive? One solution that I can think of is to store the maps in a separate table and relate them to the base table. But I would like to know the best solution. Please let me know what would be the best way to do this.

Thanks,
Rakesh

RE: How to store list of maps?

Posted by Rakesh Setty <se...@yahoo-inc.com>.
Hi Zheng,

	I can have the data in the format you have mentioned. Please advise how I can have list of maps in this format as a field in a table.

Thanks,
Rakesh

-----Original Message-----
From: Zheng Shao [mailto:zshao9@gmail.com] 
Sent: Thursday, July 02, 2009 1:58 AM
To: hive-user@hadoop.apache.org
Subject: Re: How to store list of maps?

Hi Rakesh,

Internally Hive does support list of maps, and even more nested levels.

However, we didn't open it up for the "create table" command yet. That
shouldn't be hard to do though.
We will require the list to be separated by ^B, and map items to be
separated by ^C, while map key and value separated by ^D.

Is that a format that you can produce?

Zheng

On Wed, Jul 1, 2009 at 1:19 PM, Rakesh Setty<se...@yahoo-inc.com> wrote:
> Hi,
>
>
>
>             I need to store a list of maps as one of the fields of a record.
> The documentation suggests that arrays are supported only for primitive data
> types. Is there any way to do this in Hive? One solution that I can think of
> is to store the maps in a separate table and relate them to the base table.
> But I would like to know the best solution. Please let me know what would be
> the best way to do this.
>
>
>
> Thanks,
>
> Rakesh



-- 
Yours,
Zheng

Re: How to store list of maps?

Posted by Zheng Shao <zs...@gmail.com>.
Hi Rakesh,

Internally Hive does support list of maps, and even more nested levels.

However, we didn't open it up for the "create table" command yet. That
shouldn't be hard to do though.
We will require the list to be separated by ^B, and map items to be
separated by ^C, while map key and value separated by ^D.

Is that a format that you can produce?

Zheng

On Wed, Jul 1, 2009 at 1:19 PM, Rakesh Setty<se...@yahoo-inc.com> wrote:
> Hi,
>
>
>
>             I need to store a list of maps as one of the fields of a record.
> The documentation suggests that arrays are supported only for primitive data
> types. Is there any way to do this in Hive? One solution that I can think of
> is to store the maps in a separate table and relate them to the base table.
> But I would like to know the best solution. Please let me know what would be
> the best way to do this.
>
>
>
> Thanks,
>
> Rakesh



-- 
Yours,
Zheng