@Override
public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
Object... nodeOutputs) throws SemanticException {
@SuppressWarnings("unchecked")
CommonJoinOperator<JoinDesc> join = (CommonJoinOperator) nd;
ReduceSinkOperator source = (ReduceSinkOperator) stack.get(stack.size() - 2);
FilterOperator filter = (FilterOperator) stack.get(stack.size() - 3);
int srcPos = join.getParentOperators().indexOf(source);
TransitiveContext context = (TransitiveContext) procCtx;
Map<CommonJoinOperator, int[][]> filterPropagates = context.getFilterPropagates();
Map<ReduceSinkOperator, List<ExprNodeDesc>> newFilters = context.getNewfilters();
int[][] targets = filterPropagates.get(join);
if (targets == null) {
filterPropagates.put(join, targets = getTargets(join));
}
List<Operator<? extends OperatorDesc>> parents = join.getParentOperators();
for (int targetPos : targets[srcPos]) {
ReduceSinkOperator target = (ReduceSinkOperator) parents.get(targetPos);
List<ExprNodeDesc> sourceKeys = source.getConf().getKeyCols();
List<ExprNodeDesc> targetKeys = target.getConf().getKeyCols();
ExprNodeDesc predicate = filter.getConf().getPredicate();
ExprNodeDesc replaced = ExprNodeDescUtils.replace(predicate, sourceKeys, targetKeys);
if (replaced != null && !filterExists(target, replaced)) {
List<ExprNodeDesc> prev = newFilters.get(target);