Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package edu.uci.ics.hivesterix.logical.plan.visitor;
 
 import java.util.List;
 
 import  org.apache.hadoop.hive.ql.exec.FilterOperator;
 import  org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
 import  org.apache.hadoop.hive.ql.plan.FilterDesc;
public class FilterVisitor extends DefaultVisitor {
    @Override
    public Mutable<ILogicalOperatorvisit(FilterOperator operator,
            Mutable<ILogicalOperatorAlgebricksParentOperatorRefTranslator t) {
        Schema currentSchema = t.generateInputSchema(operator.getParentOperators().get(0));
        FilterDesc desc = (FilterDesc) operator.getConf();
        ExprNodeDesc predicate = desc.getPredicate();
        t.rewriteExpression(predicate);
        Mutable<ILogicalExpressionexprs = t.translateScalarFucntion(desc.getPredicate());
        ILogicalOperator currentOperator = new SelectOperator(exprs);
        currentOperator.getInputs().add(AlgebricksParentOperatorRef);
        // populate the schema from upstream operator
        operator.setSchema(operator.getParentOperators().get(0).getSchema());
        List<LogicalVariablelatestOutputSchema = t.getVariablesFromSchema(currentSchema);
        t.rewriteOperatorOutputSchema(latestOutputSchemaoperator);
        return new MutableObject<ILogicalOperator>(currentOperator);
    }
New to GrepCode? Check out our FAQ X