Schema baseSchema = new Schema("schema", Fields.parse("name:string, money:int, country:string"));
builder.addIntermediateSchema(baseSchema);
builder.setGroupByFields("country");
builder.setOrderBy(new OrderBy().add("country", Order.ASC).add("money", Order.DESC)
.add("name", Order.ASC));
builder.addInput(new Path(INPUT), new HadoopInputFormat(TextInputFormat.class),
new MyInputProcessor());
builder.setTupleReducer(new MyGroupHandler());
builder.setOutput(new Path(OUTPUT), new HadoopOutputFormat(SequenceFileOutputFormat.class),
DoubleWritable.class, NullWritable.class);
// Configure extra outputs