Re: Defining collection items terminated by for a nested data type

2012-10-01 Thread Sadananda Hegde
I tested the nesting with the following DDL. CREATE TABLE test_tbl ( col1 STRING, col2: INT, col3 MAP>) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' COLLECTION ITEMS TERMINATED BY ',' MAP KEYS TERMINATED BY ':' LINES TERMINATED BY '\n' STORED AS TEXTFILE; I was able to load and

Re: Defining collection items terminated by for a nested data type

2012-09-28 Thread Sadananda Hegde
Yes, you can define the nested structure; but I had the incorrect syntax in the DDL. The correct syntax to create such table is: CREATE TABLE table_1(f1 int, f2 string, f3 array >>) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' COLLECTION ITEMS TERMINATED BY ',' MAP KEYS TERMINATED BY '=' L

Re: Defining collection items terminated by for a nested data type

2012-09-28 Thread Sadananda Hegde
Thanks Manish. It's a good article; But it's still not clear to mehow you define when the column is of nested type (like array of maps, maps or array, etc). Just a clarification on item 2 below. 2. **What would be the seperator for map elements? For Map element separator is “=” '=' i

Re: Defining collection items terminated by for a nested data type

2012-09-28 Thread MiaoMiao
Never seen nested collections on Hive, so I'm not sure about "array >>". In my case, my arrays and maps always contains values of primitive types, such as string, int, bigint, etc. On Fri, Sep 28, 2012 at 1:01 PM, Sadananda Hegde wrote: > How does "collection items terminated by" work on a nest

RE: Defining collection items terminated by for a nested data type

2012-09-27 Thread Manish . Bhoge
Hi Sadu, See my answer below. Also this will help you to understand in detail about collection, MAP and Array. http://datumengineering.wordpress.com/2012/09/27/agility-in-hive-map-array-score-for-hive/ From: Sadananda Hegde [mailto:saduhe...@gmail.com] Sent: Friday, September 28, 2012 10:31 AM