*************************
Here is the json-data that i load:
*************************
{ "blogID" : "FJY26J1333", "date" : "2012-04-01", "name" : "vpxnksu", "comment"
: "good stuff", "contact" : { "email" : "[email protected]", "website" :
"vpxnksu.wordpress.com" } }
{ "blogID" : "VSAUMDFGSD", "date" : "2012-04-01", "name" : "yhftrcx", "comment"
: "another comment",}
*************************
Here is the hive commands :
*************************
CREATE EXTERNAL TABLE json_comments(value STRING) LOCATION
'/user/json-comments';
LOAD DATA LOCAL INPATH '/home/satish/data/inputSai/json-comments.txt' OVERWRITE
INTO TABLE json_comments;
SELECT b.blogID, c.email FROM json_comments a LATERAL VIEW json_tuple(a.value,
'blogID', 'contact') b AS blogID, contact LATERAL VIEW json_tuple(b.contact,
'email', 'website') c AS email, website;
*************************
Here r the results of map reduce:
*************************
blogidemail
[email protected]
NULLNULL
*************************
My question is why the 2nd row is coming up as Null values, i was expecting the
results to be like this:
*************************
blogidemail
[email protected]
VSAUMDFGSDNULL
Any input is appreciated in understanding this.
Thanks
S