[ 
https://issues.apache.org/jira/browse/AVRO-581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890636#action_12890636
 ] 

Tom White commented on AVRO-581:
--------------------------------

> The javadoc for setMapOutputSchema says you should only call it if it differs 
> from the final output schema and that it must always be a Pair schema. Is 
> that not clear enough?

It's clear, but I was going by analogy with Hadoop, where (I think) you can 
just call JobConf#setMapOutputKeyClass() and JobConf#setMapOutputValueClass() 
for map-only jobs. Could we do a similar thing for the Avro API?

Otherwise, I'm +1 on this.

> java: add reducer that separates keys and values when map output is pairs
> -------------------------------------------------------------------------
>
>                 Key: AVRO-581
>                 URL: https://issues.apache.org/jira/browse/AVRO-581
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>            Reporter: Doug Cutting
>            Assignee: Doug Cutting
>             Fix For: 1.4.0
>
>         Attachments: AVRO-581.patch, AVRO-581.patch, AVRO-581.patch, 
> AVRO-581.patch, weather-sorted.avro, weather.avro
>
>
> We should add a Pair<K,V> class, implementing SpecificRecord, that combines 
> instances of two schemas (specific or generic).  Pairs would be compared by 
> key, ignoring value.  The template for its schema would be:
> {code}
> {"type": "record", "name": "org.apache.avro.mapred.Pair", "fields":[
>   {"name": "key", "type":" <<insert key schema here>>},
>   {"name": "value", "order": "ignore", "type": <<insert value schema>>}
> ]}
> {code}
> When map outputs are instances of this class, a reducer may be used whose 
> reduce method is something like:
> public abstract void reduce(K key, Iterable<V> values);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to