Solved
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
Hi Everyone,
i am trying to create Hive table with data from mongodb.
I have installed mongodb in cloudera quickstart. loaded json data. sample:
{
"_id" : ObjectId("59a47286cfa9a3a73e51e749"),
"theaterId" : 1034,
"location" : {
"address" : {
"street1" : "3404 W 13th St",
"city" : "Grand Island",
"state" : "NE",
"zipcode" : "68803"
},
"geo" : {
"type" : "Point",
"coordinates" : [
-98.382164,
40.933624
]
}
}
}
i have create Hive table as below
CREATE EXTERNAL TABLE IF NOT EXISTS THEATER
(
id STRING,
theaterId INT,
loc STRUCT<address:STRUCT<street1:STRING,city:STRING,city:STRING,city:STRING,street2:STRING>,
geo:STRUCT<type:STRING,coordinates:ARRAY<DOUBLE>>
>
)
STORED BY 'com.mongodb.hadoop.hive.MongoStorageHandler'
WITH SERDEPROPERTIES ('mongo.columns.mapping'='{
"id":"_id",
"theaterId":"theaterId",
"loc":"location"
}')
TBLPROPERTIES('mongo.uri'='mongodb://localhost:27017/movie_flix.theater');when i run simple select i am able to run the application successfully.

but when i run select loc.address FROM theater;
i am getting below error
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
Did anyone face the same issue?
Thanks

