You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by wd <wd...@wdicc.com> on 2011/01/07 03:44:02 UTC

how to load data into a array of array column

hi,

I have a file like:
1000^A1,2,3,4,5^B4,5,6,7,8^B4,5,6,9,7

Expect to create a row like
col1   col2
1    [[1,2,3,4,5],[4,5,6,7,8],[4,5,6,9,7]]

So we can select it like "select col2[2][1] from t1", and the result should
"4".

The table can be created by sql:

create table t1 (
    col1 int,
    col2 array < array<int> >
)
partitioned by (dt int)
row format DELIMITED FIELDS TERMINATED BY '^A' COLLECTION ITEMS TERMINATED
BY '^B';

How to announce the second array's "COLLECTION ITEMS TERMINATED" ? Or maybe
array of array not supported ?