For anyone else wondering how to do it.

In my case I have HDFS file where each row contains key and a value . Each
value is a multiple key value pairs.
The Hive MAP type can be used to hold the key value pairs.

CREATE TABLE tablename (key STRING, value MAP<STRING,STRING>)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY fields_delimiter
COLLECTION ITEMS TERMINATED BY map_items_delimiter
MAP KEYS TERMINATED BY map_key_value_delimiter;


Shimi


On Tue, Aug 10, 2010 at 10:04 PM, John Sichi <[email protected]> wrote:

> I think that comment is out of date; you can create a map from Hive QL
> using the map function:
>
> select map('fred',40,'barney',50) from ...
>
> JVS
>
> On Aug 10, 2010, at 3:43 AM, shimi wrote:
>
> In the doc (
> http://wiki.apache.org/hadoop/Hive/Tutorial#Map.28Associative_Arrays.29_Operations)
> it is written that Map (Associative Arrays) can only be created
> programmatically currently.
> Does anyone know where can I find more details about it?
>
> Shimi
>
>
>

Reply via email to