Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 571773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:32:33+00:00 2026-05-13T13:32:33+00:00

I want to build a hadoop application which can read words from one file

  • 0

I want to build a hadoop application which can read words from one file and search in another file.

If the word exists – it has to write to one output file
If the word doesn’t exist – it has to write to another output file

I tried a few examples in hadoop. I have two questions

Two files are approximately 200MB each. Checking every word in another file might cause out of memory. Is there an alternative way of doing this?

How to write data to different files because output of the reduce phase of hadoop writes to only one file. Is it possible to have a filter for reduce phase to write data to different output files?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:32:33+00:00Added an answer on May 13, 2026 at 1:32 pm

    How I would do it:

    1. split value in ‘map’ by words, emit (<word>, <source>) (*1)
    2. you’ll get in ‘reduce’: (<word>, <list of sources>)
    3. check source-list (might be long for both/all sources)
    4. if NOT all sources are in the list, emit every time (<missingsource>, <word>)
    5. job2: job.setNumReduceTasks(<numberofsources>)
    6. job2: emit in ‘map’ (<missingsource>, <word>)
    7. job2: emit for each <missingsource> in ‘reduce’ all (null, <word>)

    You’ll end up with as much reduce-outputs as different <missingsources>, each containing the missing words for the document. You could write out the <missingsource> ONCE at the beginning of ‘reduce’ to mark the files.

    (*1) Howto find out the source in map (0.20):

    private String localname;
    private Text outkey = new Text();   
    private Text outvalue = new Text();
    ...
    public void setup(Context context) throws InterruptedException, IOException {
        super.setup(context);
    
        localname = ((FileSplit)context.getInputSplit()).getPath().toString();
    }
    
    public void map(Object key, Text value, Context context)
        throws IOException, InterruptedException {
    ...
        outkey.set(...);
        outvalue.set(localname);
        context.write(outkey, outvalue);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build an application, in which text boxes can take urdu language.
I want to build flash application that can detect the user eyes color and
I want to build a basic Client-Server application, where my android smartphone can stream
I want build a search service for one particular thing. The data is freely
I want to build a backend application to push messages from server to android
I want to build a WCF Server with MySQL Database which can communicate with
I want to build a C# application that save a pps\ppt file as SWF.
I want to build a python program that deletes all the photos from my
Want to build up a csv file, call up the default email app and
I want to build a system where an admin can create forms with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.