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

  • SEARCH
  • Home
  • 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 1095625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:09:19+00:00 2026-05-17T00:09:19+00:00

Is there a way in Hadoop to ensure that every reducer gets only one

  • 0

Is there a way in Hadoop to ensure that every reducer gets only one key that is output by the mapper ?

  • 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-17T00:09:19+00:00Added an answer on May 17, 2026 at 12:09 am

    This question is a bit unclear for me. But I think I have a pretty good idea what you want.

    First of all if you do nothing special every time a reduce is called it gets only one single key with a set of one or more values (via an iterator).

    My guess is that you want to ensure that every reducer gets exactly one ‘key-value pair’.
    There are essentially two ways of doing that:

    1. Ensure in the mapper that all keys that are output are unique. So for each key there is only one value.
    2. Force the reducer to do this by forcing a group comparator that simply classifies all keys as different.

    So if I understand your question correctly. You should implement a GroupComparator that simply states that all keys are different and should therefor be sent to a different reducer call.


    Because of other answers in this question I’m adding a bit more detail:

    There are 3 methods used for comparing keys (I pulled these code samples from a project I did using the 0.18.3 API):

    Partitioner

        conf.setPartitionerClass(KeyPartitioner.class);
    

    The partitioner is only to ensure that “things that must be the same end up on the same partition”. If you have 1 computer there is only one partition, so this won’t help much.

    Key Comparator

        conf.setOutputKeyComparatorClass(KeyComparator.class);
    

    The key comparator is used to SORT the “key-value pairs” in a group by looking at the key … which must be different somehow.

    Group Comparator

        conf.setOutputValueGroupingComparator(GroupComparator.class);
    

    The group comparator is used to group keys that are different, yet must be sent o the same reducer.

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to control the output filenames of an Hadoop Streaming job?
Is there any way to give constructor args to a Mapper in Hadoop? Possibly
Is there way to automatically maximize the output window on hitting build and then
Is there way that I can read the file from remote server using fopen
Is there any way I can set a formatter on models that will convert
Is there a way to specify multiple input files for a hadoop job? I've
Is there a way to change a valid and existing Hadoop Path object into
Is there a way to output to log the intermediate (Map Phase) output of
Every time i run a hadoop job inside my main method, the only thing
In hadoop 0.20.2 version one can add input/output compression to the jobconf in 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.