Amandeep,

Add this to your driver.....

MultipleOutputs.addNamedOutput(conf, "PHONE",TextOutputFormat.class,
Text.class, Text.class);

MultipleOutputs.addNamedOutput(conf, "NAME,
                    TextOutputFormat.class, Text.class, Text.class);



And in your reducer....

 private MultipleOutputs mos;

public void reduce(Text key, Iterator<Text> values,
            OutputCollector<Text, Text> output, Reporter reporter) {

                
          // namedOutPut = either PHONE or NAME 

        while (values.hasNext()) {
            String value = values.next().toString();
            mos.getCollector(namedOutPut, reporter).collect(
                    new Text(value), new Text(othervals));
        }
    }

    @Override
    public void configure(JobConf conf) {
        super.configure(conf);
        mos = new MultipleOutputs(conf);
    }

    public void close() throws IOException {
        mos.close();
    }



By the way, have you had a change to post your Oracle fix to
DBInputFormat ? 
If so, what is the Jira tag #?

Brian

-----Original Message-----
From: Amandeep Khurana [mailto:ama...@gmail.com] 
Sent: Friday, March 27, 2009 5:46 AM
To: core-user@hadoop.apache.org
Subject: Multiple k,v pairs from a single map - possible?

Is it possible to output multiple key value pairs from a single map
function
run?

For example, the mapper outputing <name,phone> and <name, address>
simultaneously...

Can I write multiple output.collect(...) commands?

Amandeep

Amandeep Khurana
Computer Science Graduate Student
University of California, Santa Cruz





_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

The information transmitted is intended only for the person or entity to 
which it is addressed and may contain confidential and/or privileged 
material. Any review, retransmission, dissemination or other use of, or 
taking of any action in reliance upon, this information by persons or 
entities other than the intended recipient is prohibited. If you received 
this message in error, please contact the sender and delete the material 
from any computer.


Reply via email to