Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (9 sloc) 400 Bytes
-- echo -e '1\x022\x01a\x031\x02b\x032\x01a\x021\x021.0' > /Users/tom/workspace/hadoop-book/input/hive/types/complex.txt
CREATE TABLE complex (
col1 ARRAY<INT>,
col2 MAP<STRING, INT>,
col3 STRUCT<a:STRING, b:INT, c:DOUBLE>
);
LOAD DATA LOCAL INPATH '/Users/tom/workspace/hadoop-book/input/hive/types/complex.txt'
OVERWRITE INTO TABLE complex;
SELECT col1[0], col2['b'], col3.c FROM complex;