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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:30:43+00:00 2026-06-07T14:30:43+00:00

I want to write two different types of output from the same reducer, into

  • 0
  1. I want to write two different types of output from the same reducer, into two different directories.

I am able to use multipleoutputs feature in hadoop to write to different files, but they both go to the same output folder.

I want to write each file from the same reduce to a different folder.

Is there a way for doing this?

If I try putting for example “hello/testfile”, as the second argument, it shows invaid argument. So I m not able to write to different folders.

  1. If the above case is not possible, the is it possible for the mapper to read only specific files from an input folder?

Please help me.

Thanks in advance!


Thanks for the reply. I am able to read a file successfully using then above method. But in distributed mode, I am not able to do so. In the reducer, I have
set:

mos.getCollector("data", reporter).collect(new Text(str_key), new Text(str_val));

(Using multiple outputs, and in Job Conf:
I tried using

FileInputFormat.setInputPaths(conf2, "/home/users/mlakshm/opchk285/data-r-00000*");

as well as

FileInputFormat.setInputPaths(conf2, "/home/users/mlakshm/opchk285/data*");

But, it gives the following error:

cause:org.apache.hadoop.mapred.InvalidInputException: Input Pattern hdfs://mentat.cluster:54310/home/users/mlakshm/opchk295/data-r-00000* matches 0 files
  • 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-07T14:30:44+00:00Added an answer on June 7, 2026 at 2:30 pm

    Copy the MultipleOutputs code into your code base and loosen the restriction on allowable characters. I can’t see any valid reason for the restrictions anyway.

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

Sidebar

Related Questions

I want to write a script that compares two directories. However, the file names
I have two XML sources to retrieve data from. I want to use them
I want to write several functions that are only different in the types of
I want to write two different implementations of class Stack. (1) template<typename element_type, typename
I want to write a translator between two languages, and after some reading on
I want to write class whose constructor takes two parameters, but the arguments are
I want to write a long running process (linux daemon) that serves two purposes:
I want to write a cmp -like function that compares two version numbers and
Let's say there are two python scripts that want to write data to the
I want write a simple query which will fetch data from a table (which

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.