org.apache.pig.newplan.logical.rules
Class PartitionFilterOptimizer.PartitionFilterPushDownTransformer

java.lang.Object
  extended by org.apache.pig.newplan.optimizer.Transformer
      extended by org.apache.pig.newplan.logical.rules.PartitionFilterOptimizer.PartitionFilterPushDownTransformer
Enclosing class:
PartitionFilterOptimizer

public class PartitionFilterOptimizer.PartitionFilterPushDownTransformer
extends Transformer


Field Summary
protected  OperatorSubPlan subPlan
           
 
Constructor Summary
PartitionFilterOptimizer.PartitionFilterPushDownTransformer()
           
 
Method Summary
 boolean check(OperatorPlan matched)
          check if the transform should be done.
protected  List<String> getMappedKeys(String[] partitionKeys)
          The partition keys in the argument are as reported by LoadMetadata#getPartitionKeys(String, org.apache.hadoop.conf.Configuration).
 OperatorPlan reportChanges()
          Report what parts of the tree were transformed.
protected  void setupColNameMaps()
           
 void transform(OperatorPlan matched)
          Transform the tree
protected  void updateMappedColNames(Expression expr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subPlan

protected OperatorSubPlan subPlan
Constructor Detail

PartitionFilterOptimizer.PartitionFilterPushDownTransformer

public PartitionFilterOptimizer.PartitionFilterPushDownTransformer()
Method Detail

check

public boolean check(OperatorPlan matched)
              throws FrontendException
Description copied from class: Transformer
check if the transform should be done. If this is being called then the pattern matches, but there may be other criteria that must be met as well.

Specified by:
check in class Transformer
Parameters:
matched - the sub-set of the plan that matches the pattern. This subset has the same graph as the pattern, but the operators point to the same objects as the plan to be matched.
Returns:
true if the transform should be done.
Throws:
FrontendException

reportChanges

public OperatorPlan reportChanges()
Description copied from class: Transformer
Report what parts of the tree were transformed. This is so that listeners can know which part of the tree to visit and modify schemas, annotations, etc. So any nodes that were removed need will not be in this plan, only nodes that were added or moved.

Specified by:
reportChanges in class Transformer
Returns:
OperatorPlan that describes just the changed nodes.

transform

public void transform(OperatorPlan matched)
               throws FrontendException
Description copied from class: Transformer
Transform the tree

Specified by:
transform in class Transformer
Parameters:
matched - the sub-set of the plan that matches the pattern. This subset has the same graph as the pattern, but the operators point to the same objects as the plan to be matched.
Throws:
FrontendException

updateMappedColNames

protected void updateMappedColNames(Expression expr)

getMappedKeys

protected List<String> getMappedKeys(String[] partitionKeys)
The partition keys in the argument are as reported by LoadMetadata#getPartitionKeys(String, org.apache.hadoop.conf.Configuration). The user may have renamed these by providing a schema with different names in the load statement - this method will replace the former names with the latter names.

Parameters:
partitionKeys -
Returns:

setupColNameMaps

protected void setupColNameMaps()
                         throws FrontendException
Throws:
FrontendException


Copyright © 2007-2012 The Apache Software Foundation