Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Is there a way to prepare HashMap in InputFormat and share it with Reducer

Is there a way to prepare HashMap in InputFormat and share it with Reducer

Explorer

Hi, 

 

I have written custom RecordReader and Custom InputFormat. I will have date in file name and i can collect that at RecordReader.

 

Now, i have a requirement to prepare HashMap with all dates, and need to use it while partitioning.

 

Is there any possibility to create HashMap in InputFormat and share it with context.?

 

Thank You.

1 REPLY 1
Highlighted

Re: Is there a way to prepare in InputFormat and share it with Reducer

Master Guru
There is nothing as straight-forward, but there are alternative approaches
you can think of - such as if you know the input beforehand, you can
pre-prepare this information and send it as a cache-file to the reducer.