if (listMapJoinOps.contains(mapJoin)) {
ctx.setCurrAliasId(null);
ctx.setCurrTopOp(null);
Map<Operator<? extends Serializable>, GenMapRedCtx> mapCurrCtx = ctx.getMapCurrCtx();
mapCurrCtx.put((Operator<? extends Serializable>)nd, new GenMapRedCtx(ctx.getCurrTask(), null, null));
return null;
}
ctx.setCurrMapJoinOp(mapJoin);
Task<? extends Serializable> currTask = ctx.getCurrTask();
GenMRMapJoinCtx mjCtx = ctx.getMapJoinCtx(mapJoin);
if (mjCtx == null) {
mjCtx = new GenMRMapJoinCtx();
ctx.setMapJoinCtx(mapJoin, mjCtx);
}
mapredWork mjPlan = GenMapRedUtils.getMapRedWork();
Task<? extends Serializable> mjTask = TaskFactory.get(mjPlan, parseCtx.getConf());
tableDesc tt_desc =
PlanUtils.getIntermediateFileTableDesc(PlanUtils.sortFieldSchemas(
PlanUtils.getFieldSchemasFromRowSchema(mapJoin.getSchema(), "temporarycol")));
// generate the temporary file
Context baseCtx = parseCtx.getContext();
String taskTmpDir = baseCtx.getMRTmpFileURI();
// Add the path to alias mapping
mjCtx.setTaskTmpDir(taskTmpDir);
mjCtx.setTTDesc(tt_desc);
mjCtx.setRootMapJoinOp(sel);
sel.setParentOperators(null);
// Create a file sink operator for this file name
Operator<? extends Serializable> fs_op =
OperatorFactory.get
(new fileSinkDesc(taskTmpDir, tt_desc,
parseCtx.getConf().getBoolVar(HiveConf.ConfVars.COMPRESSINTERMEDIATE)),
mapJoin.getSchema());
assert mapJoin.getChildOperators().size() == 1;
mapJoin.getChildOperators().set(0, fs_op);
List<Operator<? extends Serializable>> parentOpList = new ArrayList<Operator<? extends Serializable>>();
parentOpList.add(mapJoin);
fs_op.setParentOperators(parentOpList);
currTask.addDependentTask(mjTask);
ctx.setCurrTask(mjTask);
ctx.setCurrAliasId(null);
ctx.setCurrTopOp(null);
Map<Operator<? extends Serializable>, GenMapRedCtx> mapCurrCtx = ctx.getMapCurrCtx();
mapCurrCtx.put((Operator<? extends Serializable>)nd, new GenMapRedCtx(ctx.getCurrTask(), null, null));
return null;
}