You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Suraj Nayak <sn...@gmail.com> on 2015/03/16 20:16:36 UTC

Reading 2 table data in MapReduce for Performing Join

Hi,

I tried reading data via HCatalog for 1 Hive table in MapReduce using
something similar to
https://cwiki.apache.org/confluence/display/Hive/HCatalog+InputOutput#HCatalogInputOutput-RunningMapReducewithHCatalog.
I was able to read successfully.

Now am trying to read 2 tables, as the requirement is to join 2 tables. I
did not find API similar to *FileInputFormat.addInputPaths* in
*HCatInputFormat*. What is the equivalent of the same in HCat ?

I had performed join using FilesInputFormat in HDFS(by getting split
information in mapper). This article(
http://www.codingjunkie.com/mapreduce-reduce-joins) helped me code join.
<http://www.codingjunkie.com/mapreduce-reduce-joins/> Can someone suggest
how I can perform join operation using HCatalog ?

Briefly, the aim is to

   - Read 2 tables (almost similar schema)
   - If key exists in both the table send it to same reducer.
   - Do some processing on the records in reducer.
   - Save the output into file/Hive table.

*P.S : The reason for using MapReduce to perform join is because of complex
requirement which can't be solved via Hive/Pig directly. *

Any help will be greatly appreciated :)

-- 
Thanks & Regards
Suraj Nayak M