MapOperator mapSupplier = MapOperator.builder(SupplierMap.class)
.name("proj.Partsupp")
.build();
/* Equijoin on partkey of part and partsupp: */
JoinOperator partsJoin = JoinOperator.builder(PartJoin.class, IntValue.class, 0, 0)
.name("partsJoin")
.build();
/* Equijoin on orderkey of orders and lineitem: */
JoinOperator orderedPartsJoin =
JoinOperator.builder(OrderedPartsJoin.class, IntValue.class, 0, 0)
.name("orderedPartsJoin")
.build();
/* Equijoin on nationkey of supplier and nation: */
JoinOperator suppliersJoin =
JoinOperator.builder(SuppliersJoin.class, IntValue.class, 0, 0)
.name("suppliersJoin")
.build();
/* Equijoin on (partkey,suppkey) of parts and orderedParts: */
JoinOperator filteredPartsJoin =
JoinOperator.builder(FilteredPartsJoin.class, IntPair.class, 0, 0)
.name("filteredPartsJoin")
.build();
/* Equijoin on suppkey of filteredParts and suppliers: */
JoinOperator partListJoin =
JoinOperator.builder(PartListJoin.class, IntValue.class , 0, 0)
.name("partlistJoin")
.build();
/* Aggregate sum(amount) by (nation,year): */
ReduceOperator sumAmountAggregate =
ReduceOperator.builder(AmountAggregate.class, StringIntPair.class, 0)
.name("groupyBy")
.build();
/* Connect input filters: */
filterPart.setInput(partInput);
mapPartsupp.setInput(partSuppInput);
mapOrder.setInput(ordersInput);
mapLineItem.setInput(lineItemInput);
mapSupplier.setInput(supplierInput);
/* Connect equijoins: */
partsJoin.setFirstInput(filterPart);
partsJoin.setSecondInput(mapPartsupp);
orderedPartsJoin.setFirstInput(mapOrder);
orderedPartsJoin.setSecondInput(mapLineItem);
suppliersJoin.setFirstInput(mapSupplier);
suppliersJoin.setSecondInput(nationInput);
filteredPartsJoin.setFirstInput(partsJoin);
filteredPartsJoin.setSecondInput(orderedPartsJoin);
partListJoin.setFirstInput(filteredPartsJoin);
partListJoin.setSecondInput(suppliersJoin);
/* Connect aggregate: */
sumAmountAggregate.setInput(partListJoin);
/* Connect sink: */