org.apache.pig.impl.logicalLayer.optimizer
Class OpLimitOptimizer
java.lang.Object
org.apache.pig.impl.plan.optimizer.Transformer<LogicalOperator,LogicalPlan>
org.apache.pig.impl.logicalLayer.optimizer.LogicalTransformer
org.apache.pig.impl.logicalLayer.optimizer.OpLimitOptimizer
public class OpLimitOptimizer
- extends LogicalTransformer
A visitor to discover if any schema has been specified for a file being
loaded. If so, a projection will be injected into the plan to cast the
data being loaded to the appropriate types. The optimizer can then come
along and move those casts as far down as possible, or in some cases remove
them altogether. This visitor does not handle finding the schemas for the
file, that has already been done as part of parsing.
Fields inherited from class org.apache.pig.impl.plan.optimizer.Transformer |
mPlan |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OpLimitOptimizer
public OpLimitOptimizer(LogicalPlan plan)
OpLimitOptimizer
public OpLimitOptimizer(LogicalPlan plan,
ExecType mode)
check
public boolean check(List<LogicalOperator> nodes)
throws OptimizerException
- 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<LogicalOperator,LogicalPlan>
- Parameters:
nodes
- - List of nodes declared in transform ($1 = nodes[0],
etc.) Remember that somes entries in node[] may be NULL since they may
not be created until after the transform.
- Returns:
- true if the transform should be done.
- Throws:
OptimizerException
transform
public void transform(List<LogicalOperator> nodes)
throws OptimizerException
- Description copied from class:
Transformer
- Transform the tree
- Specified by:
transform
in class Transformer<LogicalOperator,LogicalPlan>
- Parameters:
nodes
- - List of nodes declared in transform ($1 = nodes[0],
etc.) This call must destruct any nodes that are being removed as part
of the transform and remove them from the nodes vector and construct
any that are being created as part of the transform and add them at the
appropriate point to the nodes vector.
- Throws:
OptimizerException
processNode
public void processNode(LOLimit limit)
throws OptimizerException
- Throws:
OptimizerException
Copyright © ${year} The Apache Software Foundation