org.apache.pig.newplan
Class PColFilterExtractor

java.lang.Object
  extended by org.apache.pig.newplan.PlanVisitor
      extended by org.apache.pig.newplan.PColFilterExtractor

public class PColFilterExtractor
extends PlanVisitor

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.newplan.PlanVisitor
currentWalker, DEFAULT_SCOPE, plan
 
Constructor Summary
PColFilterExtractor(OperatorPlan plan, List<String> partitionCols)
           
 
Method Summary
 boolean canPushDown()
           
 Expression getExpression(LogicalExpression op)
           
 Expression getPColCondition()
           
 boolean isFilterRemovable()
           
 void visit()
          Entry point for visiting the plan.
protected  void visit(ProjectExpression project)
           
 
Methods inherited from class org.apache.pig.newplan.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(OperatorPlan 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 FrontendException
Description copied from class: PlanVisitor
Entry point for visiting the plan.

Overrides:
visit in class PlanVisitor
Throws:
VisitorException - if an error is encountered while visiting.
FrontendException

visit

protected void visit(ProjectExpression project)
              throws FrontendException
Throws:
FrontendException

getPColCondition

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

isFilterRemovable

public boolean isFilterRemovable()
Returns:
the filterRemovable

getExpression

public Expression getExpression(LogicalExpression op)
                         throws FrontendException
Throws:
FrontendException

canPushDown

public boolean canPushDown()


Copyright © 2007-2012 The Apache Software Foundation