org.apache.pig.impl.logicalLayer
Class PColFilterExtractor
java.lang.Object
org.apache.pig.impl.plan.PlanVisitor<LogicalOperator,LogicalPlan>
org.apache.pig.impl.logicalLayer.LOVisitor
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.
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PColFilterExtractor
public PColFilterExtractor(LogicalPlan plan,
List<String> partitionCols)
- Parameters:
plan
- logical plan corresponding the filter's comparison conditionpartitionCols
- list of partition columns of the table which is
being loaded in the LOAD statement which is input to the filter
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