if (columnsPruned.size()!=0)
{
MultiMap<Integer, Column> mappedFields = new MultiMap<Integer, Column>();
List<Column> columns = new ArrayList<Column>();
columns.add(new Column(new Pair<Integer, Integer>(0, 0)));
mappedFields.put(0, columns);
LogicalOperator nextOp = lOp;
if (lOp instanceof LOCogroup)
{
ArrayList<Boolean> flattenList = new ArrayList<Boolean>();
ArrayList<LogicalPlan> generatingPlans = new ArrayList<LogicalPlan>();
String scope = lOp.getOperatorKey().scope;
for (int i=0;i<=predecessors.size();i++) {
if (!columnsToPrune.contains(new Pair<Integer, Integer>(0, i)))
{
LogicalPlan projectPlan = new LogicalPlan();
LogicalOperator projectInput = lOp;
ExpressionOperator column = new LOProject(projectPlan, new OperatorKey(scope, NodeIdGenerator.getGenerator().getNextNodeId(scope)), projectInput, i);
flattenList.add(false);
projectPlan.add(column);
generatingPlans.add(projectPlan);
}
columns = new ArrayList<Column>();
columns.add(new Column(new Pair<Integer, Integer>(0, i+1)));
mappedFields.put(i+1, columns);
}
LOForEach forEach = new LOForEach(mPlan, new OperatorKey(scope, NodeIdGenerator.getGenerator().getNextNodeId(scope)), generatingPlans, flattenList);
LogicalOperator succ = mPlan.getSuccessors(lOp).get(0);
mPlan.add(forEach);