hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Owen O'Malley (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-115) Hadoop should allow the user to use SequentialFileOutputformat as the output format and to choose key/value classes that are different from those for map output.
Date Mon, 03 Apr 2006 16:14:56 GMT
    [ http://issues.apache.org/jira/browse/HADOOP-115?page=comments#action_12372967 ] 

Owen O'Malley commented on HADOOP-115:
--------------------------------------

I should have addressed the combiner before. *smile* Of course the combiner input and output
has to match the map output types. So, it looks like:

map: k1,v1 -> seq(k2,v2)
combine: k2,seq(v2) -> seq(k2,v2)
reduce: k2, seq(v2) -> seq(k3,v3)

So the only extra code is to set/get the types for k2/v2 (or equivalent k3/v3), although I
would recommend adding a type check in the reduce collector. It is completely upward compatible.

As for user confusion, I've already had to explain this restriction (k2==k3 and v2==v3) far
more times than I'd like.

On a side note, we could hack around the problem by defining an OutputFormat that uses SequenceFileWriter,
but doesn't open the file until the first key/value pair is written and takes the types from
the first instances. But that breaks when someone puts the type check into the reduce collector.

> Hadoop should allow the user to use SequentialFileOutputformat as the output format and
to choose  key/value classes that are different from those for map output.
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: HADOOP-115
>          URL: http://issues.apache.org/jira/browse/HADOOP-115
>      Project: Hadoop
>         Type: Improvement

>   Components: mapred
>     Reporter: Runping Qi

>
> When map tasks write intermediate data out, they always use SequencialFile RecordWriter
with key/value classes from the job object.
> When the reducers write the final results out, its output format is obtained from the
job object. By default, it is TextOutputFormat, and no conflicts.
> However, if one wants to use SequencialFileFormat for the final results, then the key/value
classes are also obtained from the job object, the same as the map tasks' output. Now we have
a problem. It is impossible for the map outputs and reducer outputs use different key/value
classes, if one wants the reducers generate outputs in SequentialFileFormat.
> A simple fix would be to add another two attributes to JobConf class: mapOutputLeyClass
and mapOutputValueClass. That allows the user to have different key/value classes for the
intermediate and final outputs.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message