new org.apache.pig.newplan.logical.relational.LogicalPlan();
LogicalSchema aschema = new LogicalSchema();
aschema.addField(new LogicalSchema.LogicalFieldSchema("id", null, DataType.BYTEARRAY));
aschema.addField(new LogicalSchema.LogicalFieldSchema("d", null, DataType.BYTEARRAY));
LOLoad load = new LOLoad(new FileSpec("/test/d.txt", new FuncSpec("org.apache.pig.builtin.PigStorage")), aschema, expected, null);
expected.add(load);
LOForEach foreach = new LOForEach(expected);
org.apache.pig.newplan.logical.relational.LogicalPlan innerPlan = new org.apache.pig.newplan.logical.relational.LogicalPlan();
LOInnerLoad l1 = new LOInnerLoad(innerPlan, foreach, 0);
innerPlan.add(l1);
LOInnerLoad l2 = new LOInnerLoad(innerPlan, foreach, 1);
innerPlan.add(l2);
List<LogicalExpressionPlan> eps = new ArrayList<LogicalExpressionPlan>();
LOGenerate gen = new LOGenerate(innerPlan, eps, new boolean[] {false, true});
LogicalExpressionPlan p1 = new LogicalExpressionPlan();
p1.add(new ProjectExpression(p1, 0, -1, gen));
LogicalExpressionPlan p2 = new LogicalExpressionPlan();
p2.add(new ProjectExpression(p2, 1, -1, gen));
eps.add(p1);
eps.add(p2);
innerPlan.add(gen);
innerPlan.connect(l1, gen);
innerPlan.connect(l2, gen);
foreach.setInnerPlan(innerPlan);
expected.add(foreach);
LOStore s = new LOStore(expected, new FileSpec("/test/empty", new FuncSpec("org.apache.pig.builtin.PigStorage")));
expected.add(s);
expected.connect(load, foreach);
expected.connect(foreach, s);