private final String OUTPUT_PATH = getTestRoot() + "/output";
@Test
public void testMain() throws IOException {
Hfs source = new Hfs(new SequenceFile(new Fields("key", "value")), INPUT_PATH);
TupleEntryCollector tc = source.openForWrite(CascadingUtil.get().getFlowProcess());
tc.add(new Tuple("k0", 1));
tc.add(new Tuple("k0", 2));
tc.add(new Tuple("k1", 10));
tc.add(new Tuple("k1", -2));
tc.add(new Tuple("k1", -9));
tc.add(new Tuple("k2", -3));
tc.add(new Tuple("k2", -6));
tc.close();
Tap sink = new Hfs(new SequenceFile(new Fields("key", "sum")), OUTPUT_PATH);
Pipe pipe = new Pipe("pipe");
pipe = Combiner.assembly(pipe, new SumExactAggregator(1), new Fields("key"), new Fields("value"), new Fields("sum"));