org.apache.pig.newplan
Class FilterExtractor

java.lang.Object
  extended by org.apache.pig.newplan.FilterExtractor

public class FilterExtractor
extends Object

This is a rewrite of PColFilterExtractor We traverse the expression plan bottom up and separate it into two plans - pushdownExprPlan, plan that can be pushed down to the loader and - filterExprPlan, remaining plan that needs to be evaluated by pig


Field Summary
protected  LogicalExpressionPlan filteredPlan
          Plan that is created after all pushable filters are removed
protected  LogicalExpressionPlan originalPlan
          We visit this plan to create the filteredPlan
protected  LogicalExpressionPlan pushdownExprPlan
          Plan that can be pushed down
 
Constructor Summary
FilterExtractor(LogicalExpressionPlan plan, List<String> partitionCols)
           
 
Method Summary
 boolean canPushDown()
           
static Expression getExpression(LogicalExpression op)
           
 LogicalExpressionPlan getFilteredPlan()
           
 Expression getPColCondition()
           
 boolean isFilterRemovable()
           
 void visit()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

originalPlan

protected LogicalExpressionPlan originalPlan
We visit this plan to create the filteredPlan


filteredPlan

protected LogicalExpressionPlan filteredPlan
Plan that is created after all pushable filters are removed


pushdownExprPlan

protected LogicalExpressionPlan pushdownExprPlan
Plan that can be pushed down

Constructor Detail

FilterExtractor

public FilterExtractor(LogicalExpressionPlan 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
Throws:
FrontendException

getFilteredPlan

public LogicalExpressionPlan getFilteredPlan()
Returns:
new filtered plan after pushdownable filters are removed

canPushDown

public boolean canPushDown()
Returns:
true if pushdown is possible

isFilterRemovable

public boolean isFilterRemovable()
Returns:
the filterRemovable

getPColCondition

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

getExpression

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


Copyright © 2007-2012 The Apache Software Foundation