Removing last ',' in second row would make result as you expected. I can't tell it's bug or not.
2013/5/27 Sai Sai <saigr...@yahoo.in>: > > ************************* > Here is the json-data that i load: > ************************* > > { "blogID" : "FJY26J1333", "date" : "2012-04-01", "name" : "vpxnksu", > "comment" : "good stuff", "contact" : { "email" : "vpxn...@gmail.com", > "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: > ************************* > > blogid email > FJY26J1333 vpxn...@gmail.com > NULL NULL > > ************************* > My question is why the 2nd row is coming up as Null values, i was expecting > the results to be like this: > ************************* > > blogid email > FJY26J1333 vpxn...@gmail.com > VSAUMDFGSD NULL > > Any input is appreciated in understanding this. > Thanks > S