@Override public void map(final String[] record, final Output output) throws Exception { output.collect(record); } });
public void reduce(String key, Iterator<String[]> records, Output output) throws Exception { int count = 0; while (records.hasNext()) { // note we use col[1] -- the key is provided again as col[0] count += Integer.parseInt(records.next()[1]); } output.collect(new String[] {key, String.valueOf(count)}); } });
@Override public void map(final String[] record, final Output output) throws Exception { output.collect(record); } });
@Override public void map(final String[] record, final Output output) throws Exception { output.collect(record); } });
@Override public void map(final String[] record, final Output output) throws Exception { output.collect(record); } });
@Override public void map(final String[] record, final Output output) throws Exception { output.collect(record); } });
public void reduce(String key, Iterator<String[]> records, Output output) throws Exception { int count = 0; while (records.hasNext()) { // note we use col[1] -- the key is provided again as col[0] count += Integer.parseInt(records.next()[1]); } output.collect(new String[] {key, String.valueOf(count)}); } });
public void reduce(String key, Iterator<String[]> records, Output output) throws Exception { int count = 0; while (records.hasNext()) { // note we use col[1] -- the key is provided again as col[0] count += Integer.parseInt(records.next()[1]); } output.collect(new String[] {key, String.valueOf(count)}); } });
public void reduce(String key, Iterator<String[]> records, Output output) throws Exception { int count = 0; while (records.hasNext()) { // note we use col[1] -- the key is provided again as col[0] count += Integer.parseInt(records.next()[1]); } output.collect(new String[] {key, String.valueOf(count)}); } });
public void reduce(String key, Iterator<String[]> records, Output output) throws Exception { int count = 0; while (records.hasNext()) { // note we use col[1] -- the key is provided again as col[0] count += Integer.parseInt(records.next()[1]); } output.collect(new String[] {key, String.valueOf(count)}); } });