PhysicalPlan phyPlan = translatePlan(newLogicalPlan);
PhysicalOperator pFE = phyPlan.getSuccessors( phyPlan.getRoots().get(0) ).get(0);
assertEquals( POForEach.class, pFE.getClass() );
POForEach pForEach = (POForEach)pFE;
PhysicalPlan inputPln = pForEach.getInputPlans().get(0);
assertEquals(1, ls.getField(0).uid);
assertEquals(2, ls.getField(1).uid);
LogicalRelationalOperator fe =
(LogicalRelationalOperator) newLogicalPlan.getSuccessors(load).get(0);
assertEquals( LOForEach.class, fe.getClass() );
LOForEach forEach = (LOForEach)fe;
org.apache.pig.experimental.logical.relational.LogicalPlan innerPlan =
forEach.getInnerPlan();
assertEquals( 1, innerPlan.getSinks().size() );
assertEquals( LOGenerate.class, innerPlan.getSinks().get(0).getClass() );
LOGenerate gen = (LOGenerate)innerPlan.getSinks().get(0);
assertEquals( 2, gen.getOutputPlans().size() );
LogicalExpressionPlan genExp1 = gen.getOutputPlans().get(0);
assertEquals( 1, genExp1.getSources().size() );
assertEquals( ProjectExpression.class, genExp1.getSources().get(0).getClass() );
ProjectExpression prj1 = (ProjectExpression) genExp1.getSources().get(0);
assertEquals( ls.getField(0).uid, prj1.getUid() );
LogicalExpressionPlan genExp2 = gen.getOutputPlans().get(1);
assertEquals( UserFuncExpression.class, genExp2.getSources().get(0).getClass() );
assertEquals( ProjectExpression.class, genExp2.getSinks().get(0).getClass() );
ProjectExpression prj2 = (ProjectExpression)genExp2.getSinks().get(0);
assertEquals( ls.getField(1).uid, prj2.getUid() );
assertEquals( BagDereferenceExpression.class, genExp2.getPredecessors(prj2).get(0).getClass() );
assertEquals( 0, ((BagDereferenceExpression)genExp2.getPredecessors(prj2).get(0)).getBagColNum() );
assertEquals( 1, inputPln.getRoots().size() );
assertEquals( POProject.class, inputPln.getRoots().get(0).getClass() );
assertEquals( 0, ((POProject)inputPln.getRoots().get(0)).getColumn() );
PhysicalPlan inputPln2 = pForEach.getInputPlans().get(1);
assertEquals( 1, inputPln2.getRoots().size() );
assertEquals( POProject.class, inputPln2.getRoots().get(0).getClass() );
assertEquals(1, ((POProject)inputPln2.getRoots().get(0)).getColumn() );
assertEquals( POUserFunc.class, inputPln2.getLeaves().get(0).getClass() );
assertEquals( "org.apache.pig.builtin.COUNT",