We used the MongoDB Connector for Hadoop but did not use MapReduce. This was a small trial to see if Cognos could query data in Hadoop. Here's what we did. 1. Build the MongoDB Connector for Hadoop (open source code) 2. Created an external table in Apache Hive (data physically resides in MongoDB) using the CREATE TABLE statement. The data model is denormalized (i.e. the documents contain arrays). The structure of the JSON document was left intact. (i.e. there are arrays and nested documents in the Hive external table). The Hive table is queryable using SQL, but is not suitable for use with Cognos because of the nested documents and arrays. 3. Created another Apache Hive table (data selected from external table and physically ingested into Hadoop) using the CREATE TABLE statement. The CREATE TABLE statement used a Hive lateral view in conjunction with the explode UDTF which output elements of an array as separate rows. This eliminates the arrays from the data. The nested documents were also flattened. This new Hive table was queryable using SQL via Impala. The data in this second Hive table is suitable for use with Cognos because it doesn't contain nested documents or arrays.
... View more