FileDataSource lineItems =
new FileDataSource(new IntTupleDataInFormat(), this.lineItemInputPath, "LineItems");
lineItems.setDegreeOfParallelism(this.degreeOfParallelism);
FileDataSink result =
new FileDataSink(new StringTupleDataOutFormat(), this.outputPath, "Output");
result.setDegreeOfParallelism(this.degreeOfParallelism);
MapOperator lineItemFilter =
MapOperator.builder(new LineItemFilter())
.name("LineItem Filter")
.build();
lineItemFilter.setDegreeOfParallelism(this.degreeOfParallelism);
ReduceOperator groupByReturnFlag =
ReduceOperator.builder(new GroupByReturnFlag(), StringValue.class, 0)
.name("groupyBy")
.build();
lineItemFilter.setInput(lineItems);
groupByReturnFlag.setInput(lineItemFilter);
result.setInput(groupByReturnFlag);
return new Plan(result, "TPC-H 1");
}