org.apache.pig.impl.logicalLayer
Class PColFilterExtractor

java.lang.Object
  extended by org.apache.pig.impl.plan.PlanVisitor<LogicalOperator,LogicalPlan>
      extended by org.apache.pig.impl.logicalLayer.LOVisitor
          extended by org.apache.pig.impl.logicalLayer.PColFilterExtractor

public class PColFilterExtractor
extends LOVisitor

This Visitor works on the filter condition of a LOFilter which immediately follows a LOLoad that interacts with a metadata system (currently OWL) to read table data. The visitor looks for conditions on partition columns in the filter condition and extracts those conditions out of the filter condition. The condition on partition cols will be used to prune partitions of the table.


Field Summary
 
Fields inherited from class org.apache.pig.impl.plan.PlanVisitor
mCurrentWalker, mPlan
 
Constructor Summary
PColFilterExtractor(LogicalPlan plan, List<String> partitionCols)
           
 
Method Summary
static Expression getExpression(ExpressionOperator op)
           
 Expression getPColCondition()
           
 boolean isFilterRemovable()
           
static void throwException()
           
 void visit()
          Entry point for visiting the plan.
protected  void visit(BinaryExpressionOperator binOp)
           
protected  void visit(ExpressionOperator op)
           
 void visit(LOAdd op)
           
 void visit(LOAnd op)
           
protected  void visit(LOBinCond binCond)
           
protected  void visit(LOCast cast)
           
 void visit(LODivide op)
           
 void visit(LOEqual op)
           
 void visit(LOGreaterThan op)
           
 void visit(LOGreaterThanEqual op)
           
 void visit(LOIsNull isNull)
           
 void visit(LOLesserThan op)
           
 void visit(LOLesserThanEqual op)
           
 void visit(LOMod op)
           
 void visit(LOMultiply op)
           
 void visit(LONot not)
           
 void visit(LONotEqual op)
           
 void visit(LOOr op)
           
protected  void visit(LOProject project)
           
protected  void visit(LORegexp regexp)
           
 void visit(LOSubtract op)
           
protected  void visit(LOUserFunc udf)
          Iterate over each expression that is part of the function argument list
 
Methods inherited from class org.apache.pig.impl.logicalLayer.LOVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class org.apache.pig.impl.plan.PlanVisitor
getPlan, popWalker, pushWalker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PColFilterExtractor

public PColFilterExtractor(LogicalPlan plan,
                           List<String> partitionCols)
Parameters:
plan - logical plan corresponding the filter's comparison condition
partitionCols - list of partition columns of the table which is being loaded in the LOAD statement which is input to the filter
Method Detail

visit

public void visit()
           throws VisitorException
Description copied from class: PlanVisitor
Entry point for visiting the plan.

Overrides:
visit in class PlanVisitor<LogicalOperator,LogicalPlan>
Throws:
VisitorException - if an error is encountered while visiting.

visit

protected void visit(LOProject project)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

protected void visit(BinaryExpressionOperator binOp)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
binOp - the logical binary expression operator that has to be visited
Throws:
VisitorException

getPColCondition

public Expression getPColCondition()
Returns:
the condition on partition columns extracted from filter

isFilterRemovable

public boolean isFilterRemovable()
Returns:
the filterRemovable

getExpression

public static Expression getExpression(ExpressionOperator op)
                                throws FrontendException
Throws:
FrontendException

throwException

public static void throwException()
                           throws FrontendException
Throws:
FrontendException

visit

public void visit(LOAdd op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOAnd op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LODivide op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOGreaterThan op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOGreaterThanEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOLesserThan op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOLesserThanEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOMod op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOMultiply op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LONotEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOOr op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOSubtract op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

protected void visit(ExpressionOperator op)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
op - the logical expression operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOCast cast)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
cast - the logical cast operator that has to be visited
Throws:
VisitorException

visit

public void visit(LONot not)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

protected void visit(LORegexp regexp)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
regexp - the logical regexp operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOBinCond binCond)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
binCond - the logical binCond operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOUserFunc udf)
              throws VisitorException
Description copied from class: LOVisitor
Iterate over each expression that is part of the function argument list

Overrides:
visit in class LOVisitor
Parameters:
udf - the user defined function
Throws:
VisitorException

visit

public void visit(LOIsNull isNull)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException


Copyright © ${year} The Apache Software Foundation