PhysicalPlan secondaryPlan = new PhysicalPlan();
for (int i = 1; i < columnChainInfo.size(); i++) {
// The first item in columnChainInfo indicate the index of
// input, we have addressed
// already before we come here
ColumnInfo columnInfo = columnChainInfo.getColumnInfo(i);
POProject project = new POProject(
new OperatorKey(scope, NodeIdGenerator
.getGenerator().getNextNodeId(scope)),
rearrange.getRequestedParallelism());
if(columnInfo.isRangeProject())
project.setProjectToEnd(columnInfo.getStartCol());
else
project
.setColumns((ArrayList<Integer>) columnInfo.getColumns());
project.setResultType(columnInfo.getResultType());
secondaryPlan.addAsLeaf(project);
}
if (secondaryPlan.isEmpty()) { // If secondary key sort on the
// input as a whole
POProject project = new POProject(