@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { // Assert that there is at least one item in the stack. This should never // be called for leafs. assert(!stack.isEmpty()); // LineageCtx LineageCtx lCtx = (LineageCtx) procCtx; FilterOperator fop = (FilterOperator)nd; // Get the row schema of the input operator. // The row schema of the parent operator Operator<? extends OperatorDesc> inpOp = getParent(stack); lCtx.getIndex().copyPredicates(inpOp, fop); FilterDesc filterDesc = fop.getConf(); RowSchema rs = fop.getSchema(); if (!filterDesc.isGenerated()) { Predicate cond = new Predicate(); cond.setExpr(ExprProcFactory.getExprString( rs, filterDesc.getPredicate(), lCtx, inpOp, cond)); lCtx.getIndex().addPredicate(fop, cond); } ArrayList<ColumnInfo> inp_cols = inpOp.getSchema().getSignature(); int cnt = 0; for(ColumnInfo ci : rs.getSignature()) { lCtx.getIndex().putDependency(fop, ci, lCtx.getIndex().getDependency(inpOp, inp_cols.get(cnt++))); } return null; } }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { // Assert that there is at least one item in the stack. This should never // be called for leafs. assert(!stack.isEmpty()); // LineageCtx LineageCtx lCtx = (LineageCtx) procCtx; FilterOperator fop = (FilterOperator)nd; // Get the row schema of the input operator. // The row schema of the parent operator Operator<? extends OperatorDesc> inpOp = getParent(stack); lCtx.getIndex().copyPredicates(inpOp, fop); FilterDesc filterDesc = fop.getConf(); RowSchema rs = fop.getSchema(); if (!filterDesc.isGenerated()) { Predicate cond = new Predicate(); cond.setExpr(ExprProcFactory.getExprString( rs, filterDesc.getPredicate(), lCtx, inpOp, cond)); lCtx.getIndex().addPredicate(fop, cond); } ArrayList<ColumnInfo> inp_cols = inpOp.getSchema().getSignature(); int cnt = 0; for(ColumnInfo ci : rs.getSignature()) { lCtx.getIndex().putDependency(fop, ci, lCtx.getIndex().getDependency(inpOp, inp_cols.get(cnt++))); } return null; } }