foreach1.setInnerPlan(innerRelPlan);
LOGenerate loGen = new LOGenerate(innerRelPlan);
innerRelPlan.add(loGen);
LOInnerLoad innerLoad1 = new LOInnerLoad(innerRelPlan, foreach1, 2);
innerRelPlan.add(innerLoad1);
innerRelPlan.connect(innerLoad1, loGen);
// Create expression inner plan #1 of input #1
LogicalExpressionPlan innerPlan1 = new LogicalExpressionPlan();
ProjectExpression project11 = new ProjectExpression(innerPlan1, 0, 2, loGen);
List<Integer> projections1 = new ArrayList<Integer>();
projections1.add(1);
projections1.add(2);
//ProjectExpression project12 = new ProjectExpression(innerPlan1, project11, projections1);
//project12.setSentinel(false);
DereferenceExpression project12 = new DereferenceExpression(innerPlan1, projections1);
// innerPlan1.connect(project11, project12);
innerPlan1.connect(project12, project11);
// Create expression inner plan #1 of input #2
LogicalExpressionPlan innerPlan2 = new LogicalExpressionPlan();
innerLoad1 = new LOInnerLoad(innerRelPlan, foreach1, 0);
innerRelPlan.add(innerLoad1);
innerRelPlan.connect(innerLoad1, loGen);
ProjectExpression project21 = new ProjectExpression(innerPlan2, 1, 0, loGen);
innerLoad1 = new LOInnerLoad(innerRelPlan, foreach1, 1);
innerRelPlan.add(innerLoad1);
innerRelPlan.connect(innerLoad1, loGen);
//ProjectExpression project22 = new ProjectExpression(innerPlan2, 2, 1, loGen);
ProjectExpression project22 = new ProjectExpression(innerPlan2, 2, 0, loGen);