hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sunderlin, Mark" <mark.sunder...@teamaol.com>
Subject An array and a map in the same Hive table: Can Separator for Map KV pairs be different than Separator for Array elements?
Date Thu, 14 Jun 2012 19:26:33 GMT
If my data has three columns and a typical row looks like:

5754^E ContentQuality5,Knowledge,Knowledge/Nature,UnFlagged,EarthReport^EdisplayHeight=293&displayWidth=570&imid=09177970492035608320&sid=577&skey=63&videoid=506875580

I have an integer, an array, and a map.
Columns separator is a Control E (^E)
Array elements are separated by a comma (,)
Map key/value pairs are separated by a ampersand (&), and keys are separated from values
by the equals sign (=)

Pretty sure I want this create:

Create table mark_test
Row_num	int,
Tags		array<string>,
Keys		map<string, string>

row format delimited
    fields terminated by '\005'  -- Control E 
    collection items terminated by '\&'  
    map keys terminated by '=' ;

Question:  
Does the 'Collection items terminated by' apply to just the map, or does it also set the item
terminator for my array?
If no
	Great! Life is good for me!
If yes
	Ugh.  Can I have some way have a separate item terminator for the array and the map or do
I need to manipulate the data before loading to get the map and array's item terminator to
be the same?


---
Mark E. Sunderlin
Solutions Architect   |AOL Core Data Technologies
P: 703-265-6935       |C: 540-327-6222 | AIM: MESunderlin
22000 AOL Way,  Dulles, VA  20166



Mime
View raw message