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 8871061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:53:11+00:00 2026-06-14T17:53:11+00:00

The mapper outputs the value only once. But when i checked the combiner is

  • 0

The mapper outputs the value only once. But when i checked the combiner is having the value twice. This is really strange to me.

Pls help.

Module of map code from where output is sent:

for(int i = 0; i<alcmapi.size(); i++)
{
    int section = 0;

    for(int j = 0; j<alcmapj.size(); j++)
    {
        if(!alcmapi.get(i).getid().equals(alcmapj.get(j).getid()))
        {
            int fi = Integer.parseInt(alcmapi.get(i).getField());
            int fj = Integer.parseInt(alcmapj.get(j).getField());

            ArrayList<CustomMap> al = new ArrayList<CustomMap>();
            al.add(new CustomMap(alcmapi.get(i).getid(), fi));
            al.add(new CustomMap(alcmapj.get(j).getid(), fj));


            if(fi<fj)
            {
                section = fi;
            }
            else
            {
                section = fj;
            }
            Collections.sort(al);
            {
                output.collect(new Text(t+" "+al.get(0).getid()), new Text(al.get(1).getid()+"  "+section));         

            }
        }
    }
}

In combiner:

I see that the value corresponding to a key appears doubled when I check here:

while(values.hasNext()){
    String val = values.next().toString();
    System.out.println("val:"+val);
}

Thanks in advance!

  • 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-06-14T17:53:12+00:00Added an answer on June 14, 2026 at 5:53 pm

    Looks like you test all elements against all other elements. For example, if elements 3 and 5 meet the criteria then you’d write out the pair once for i=3, j=5 and once again for i=5, j=3.

    I suggest you change your inner loop to:

    for(int j = i+1; j<alcmapj.size(); j++)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mapper whose output value is set to be an interface like
I am using Dozer mapper to map Service objects to Value objects. I am
I have this mapper defined: mapper(Resource, resource_table, properties = {'type' : relation(ResourceType,lazy = False),
I am trying to create a mapper only job via AWS (a streaming job).
We have tried it using an orm mapper tool, but it opens en closes
Let us take this example scenario: There exists a really complex function that involves
This may seem like a stupid question, but I fail to see the problem
Trying to create a mapper for an Microsoft Office object to POCO's and found
I have some problem with Emit mapper when I try to save in database
Is there an OR/M (object relational mapper) that can be used in Classic ASP?

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.