}
private POPackage compileToLR_GR_PackTrio(LogicalRelationalOperator relationalOp, String customPartitioner,
boolean[] innerFlags, MultiMap<Integer, LogicalExpressionPlan> innerPlans) throws FrontendException {
POGlobalRearrange poGlobal = new POGlobalRearrange(new OperatorKey(
DEFAULT_SCOPE, nodeGen.getNextNodeId(DEFAULT_SCOPE)), relationalOp.getRequestedParallelisam());
poGlobal.setAlias(relationalOp.getAlias());
poGlobal.setCustomPartitioner(customPartitioner);
POPackage poPackage = new POPackage(new OperatorKey(DEFAULT_SCOPE, nodeGen
.getNextNodeId(DEFAULT_SCOPE)), relationalOp.getRequestedParallelisam());
poPackage.setAlias(relationalOp.getAlias());
currentPlan.add(poGlobal);
currentPlan.add(poPackage);
try {
currentPlan.connect(poGlobal, poPackage);
} catch (PlanException e1) {
int errCode = 2015;
String msg = "Invalid physical operators in the physical plan" ;
throw new LogicalToPhysicalTranslatorException(msg, errCode, PigException.BUG, e1);
}
int count = 0;
Byte type = null;
List<Operator> inputs = relationalOp.getPlan().getPredecessors(relationalOp);
for (int i=0;i<inputs.size();i++) {
Operator op = inputs.get(i);
List<LogicalExpressionPlan> plans = (List<LogicalExpressionPlan>)innerPlans.get(i);
POLocalRearrange physOp = new POLocalRearrange(new OperatorKey(
DEFAULT_SCOPE, nodeGen.getNextNodeId(DEFAULT_SCOPE)), relationalOp.getRequestedParallelisam());
physOp.setAlias(relationalOp.getAlias());
List<PhysicalPlan> exprPlans = translateExpressionPlans(relationalOp, plans);
try {
physOp.setPlans(exprPlans);