throw new SemanticException(ErrorMsg.NO_OUTER_MAPJOIN.getMsg());
if ((condn.getType() == joinDesc.RIGHT_OUTER_JOIN) && (condn.getRight() != mapJoinPos))
throw new SemanticException(ErrorMsg.NO_OUTER_MAPJOIN.getMsg());
}
RowResolver oldOutputRS = pctx.getOpParseCtx().get(op).getRR();
RowResolver outputRS = new RowResolver();
ArrayList<String> outputColumnNames = new ArrayList<String>();
Map<Byte, List<exprNodeDesc>> keyExprMap = new HashMap<Byte, List<exprNodeDesc>>();
Map<Byte, List<exprNodeDesc>> valueExprMap = new HashMap<Byte, List<exprNodeDesc>>();
// Walk over all the sources (which are guaranteed to be reduce sink operators).
// The join outputs a concatenation of all the inputs.
QBJoinTree leftSrc = joinTree.getJoinSrc();
List<Operator<? extends Serializable>> parentOps = op.getParentOperators();
List<Operator<? extends Serializable>> newParentOps = new ArrayList<Operator<? extends Serializable>>();
List<Operator<? extends Serializable>> oldReduceSinkParentOps = new ArrayList<Operator<? extends Serializable>>();
Map<String, exprNodeDesc> colExprMap = new HashMap<String, exprNodeDesc>();
// found a source which is not to be stored in memory
if (leftSrc != null) {
// assert mapJoinPos == 0;
Operator<? extends Serializable> parentOp = parentOps.get(0);
assert parentOp.getParentOperators().size() == 1;
Operator<? extends Serializable> grandParentOp = parentOp.getParentOperators().get(0);
oldReduceSinkParentOps.add(parentOp);
grandParentOp.removeChild(parentOp);
newParentOps.add(grandParentOp);
}
int pos = 0;
// Remove parent reduce-sink operators
for (String src : joinTree.getBaseSrc()) {
if (src != null) {
Operator<? extends Serializable> parentOp = parentOps.get(pos);
assert parentOp.getParentOperators().size() == 1;
Operator<? extends Serializable> grandParentOp = parentOp.getParentOperators().get(0);
grandParentOp.removeChild(parentOp);
oldReduceSinkParentOps.add(parentOp);
newParentOps.add(grandParentOp);
}
pos++;
}
//get the join keys from old parent ReduceSink operators
for (pos = 0; pos < newParentOps.size(); pos++) {
ReduceSinkOperator oldPar = (ReduceSinkOperator)oldReduceSinkParentOps.get(pos);
reduceSinkDesc rsconf = oldPar.getConf();
Byte tag = (byte)rsconf.getTag();
List<exprNodeDesc> keys = rsconf.getKeyCols();
keyExprMap.put(tag, keys);
}
// create the map-join operator
for (pos = 0; pos < newParentOps.size(); pos++) {
RowResolver inputRS = pGraphContext.getOpParseCtx().get(newParentOps.get(pos)).getRR();
List<exprNodeDesc> values = new ArrayList<exprNodeDesc>();
Iterator<String> keysIter = inputRS.getTableNames().iterator();
while (keysIter.hasNext())
{
String key = keysIter.next();
HashMap<String, ColumnInfo> rrMap = inputRS.getFieldMap(key);
Iterator<String> fNamesIter = rrMap.keySet().iterator();
while (fNamesIter.hasNext())
{
String field = fNamesIter.next();
ColumnInfo valueInfo = inputRS.get(key, field);
ColumnInfo oldValueInfo = oldOutputRS.get(key, field);
if(oldValueInfo == null)
continue;
String outputCol = oldValueInfo.getInternalName();
if (outputRS.get(key, field) == null) {