+ "D = foreach A generate owner, age/(double)C.total AS percentAge; "
+ "F = LIMIT D C.total/8;"
+ "store F into 'output';";
LogicalPlan newLogicalPlan = Util.buildLp(pigServer, query);;
optimizePlan(newLogicalPlan);
LOStore store = (LOStore)newLogicalPlan.getSinks().get(0);
LOForEach foreach1 = (LOForEach)newLogicalPlan.getPredecessors(store).get(0);
LOForEach foreach2 = (LOForEach)newLogicalPlan.getPredecessors(foreach1).get(0);
LOLimit limit = (LOLimit)newLogicalPlan.getPredecessors(foreach2).get(0);
Assert.assertTrue(newLogicalPlan.getSoftLinkPredecessors(limit).get(0) instanceof LOStore);
}