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);
}
Byte type = null;
for( int i = 0 ; i < preds.size(); i++ ) {
ArrayList<LogicalExpressionPlan> exprPlans =
(ArrayList<LogicalExpressionPlan>) cg.getExpressionPlans().get(i);
POLocalRearrange physOp = new POLocalRearrange(new OperatorKey(
DEFAULT_SCOPE, nodeGen.getNextNodeId(DEFAULT_SCOPE)), cg.getRequestedParallelisam() );
physOp.setAlias(cg.getAlias());
List<PhysicalPlan> pExprPlans = translateExpressionPlans( cg, exprPlans );
try {
physOp.setPlans(pExprPlans);
} catch (PlanException pe) {
int errCode = 2071;
String msg = "Problem with setting up local rearrange's plans.";
throw new LogicalToPhysicalTranslatorException(msg, errCode, PigException.BUG, pe);
}
try {
physOp.setIndex(i);
} catch (ExecException e1) {
// int errCode = 2058;
String msg = "Unable to set index on newly create POLocalRearrange.";
throw new IOException(msg);
}
if (exprPlans.size() > 1) {
type = DataType.TUPLE;
physOp.setKeyType(type);
} else {
type = pExprPlans.get(0).getLeaves().get(0).getResultType();
physOp.setKeyType(type);
}
physOp.setResultType(DataType.TUPLE);
currentPlan.add(physOp);
try {
currentPlan.connect(logToPhyMap.get(preds.get(i)), physOp);
currentPlan.connect(physOp, poGlobal);
} catch (PlanException e) {
int errCode = 2015;
String msg = "Invalid physical operators in the physical plan" ;
throw new LogicalToPhysicalTranslatorException(msg, errCode, PigException.BUG, e);
}
}
poPackage.setKeyType(type);
poPackage.setResultType(DataType.TUPLE);