builder.addIntermediateSchema(schema2);
builder.addInput(new Path(INPUT1), new HadoopInputFormat(TextInputFormat.class),
new TupleMapper<LongWritable, Text>() {
ITuple tupleInTuple1 = new Tuple(schema1);
ITuple tuple1 = new Tuple(tupleSchema1);
@Override
public void map(LongWritable key, Text value, TupleMRContext context, Collector collector)
throws IOException, InterruptedException {
String[] split = value.toString().split("\t");
tuple1.set("a", split[0]);
tuple1.set("b", Integer.parseInt(split[1]));
tupleInTuple1.set("partitionId", 0);
tupleInTuple1.set("tuple1", tuple1);
collector.write(tupleInTuple1);
}
});
builder.addInput(new Path(INPUT2), new HadoopInputFormat(TextInputFormat.class),
new TupleMapper<LongWritable, Text>() {
ITuple tupleInTuple2 = new Tuple(schema2);
ITuple tuple2 = new Tuple(tupleSchema2);
@Override
public void map(LongWritable key, Text value, TupleMRContext context, Collector collector)
throws IOException, InterruptedException {
String[] split = value.toString().split("\t");
tuple2.set("c", Double.parseDouble(split[0]));
tuple2.set("d", Boolean.parseBoolean(split[1]));
tupleInTuple2.set("partitionId", 0);
tupleInTuple2.set("tuple2", tuple2);
collector.write(tupleInTuple2);
}