@Override
public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
Object... nodeOutputs) throws SemanticException {
PcrOpWalkerCtx owc = (PcrOpWalkerCtx) procCtx;
FilterOperator fop = (FilterOperator) nd;
FilterOperator fop2 = null;
// The stack contains either ... TS, Filter or
// ... TS, Filter, Filter with the head of the stack being the rightmost
// symbol. So we just pop out the two elements from the top and if the
// second one of them is not a table scan then the operator on the top of
// the stack is the Table scan operator.
Node tmp = stack.pop();
Node tmp2 = stack.pop();
TableScanOperator top = null;
Operator<? extends OperatorDesc> pop = null;
if (tmp2 instanceof TableScanOperator) {
top = (TableScanOperator) tmp2;
pop = top;
} else {
top = (TableScanOperator) stack.peek();
fop2 = (FilterOperator) tmp2;
pop = fop2;
}
stack.push(tmp2);
stack.push(tmp);
// If fop2 exists (i.e this is not the top level filter and fop2 is not
// a sampling filter then we ignore the current filter
if (fop2 != null && !fop2.getConf().getIsSamplingPred()) {
return null;
}
// ignore the predicate in case it is not a sampling predicate
if (fop.getConf().getIsSamplingPred()) {