org.apache.pig.impl.logicalLayer
Class LOVisitor

java.lang.Object
  extended by org.apache.pig.impl.plan.PlanVisitor<LogicalOperator,LogicalPlan>
      extended by org.apache.pig.impl.logicalLayer.LOVisitor
Direct Known Subclasses:
AugmentBaseDataVisitor, CastFinder, ColumnPruner, DerivedDataVisitor, InputOutputFileVisitor, LineageTrimmingVisitor, LogicalExpPlanMigrationVistor, LogicalPlanCloneHelper, LogicalPlanMigrationVistor, LogToPhyTranslationVisitor, LOPrinter, PColFilterExtractor, PigServer.SortInfoSetter, PlanSetter, ProjectFixerUpper, ProjectionMapCalculator, ProjectionMapRemover, ProjectStarTranslator, RemoveRedundantOperators, ScalarFinder, SchemaAliasVisitor, SchemaCalculator, SchemaRemover, ScriptState.LogicalPlanFeatureVisitor, TopLevelProjectFinder, TypeCheckingVisitor, UDFFinder, UnionOnSchemaSetter

public abstract class LOVisitor
extends PlanVisitor<LogicalOperator,LogicalPlan>

A visitor mechanism for navigating and operating on a tree of Logical Operators. This class contains the logic to navigate the tree, but does not do anything with or to the tree. In order to operate on or extract information from the tree, extend this class. You only need to implement the methods dealing with the logical operators you are concerned with. For example, if you wish to find every LOEval in a logical plan and perform some operation on it, your visitor would look like: class MyLOVisitor extends LOVisitor { public void visitEval(LOEval e) { you're logic here } } Any operators that you do not implement the visitX method for will then be navigated through by this class. *NOTE* When invoking a visitor, you should never call one of the methods in this class. You should pass your visitor as an argument to visit() on the object you want to visit. So: RIGHT: LOEval myEval; MyVisitor v; myEval.visit(v); WRONG: LOEval myEval; MyVisitor v; v.visitEval(myEval); These methods are only public to make them accessible to the LO* objects.


Field Summary
 
Fields inherited from class org.apache.pig.impl.plan.PlanVisitor
mCurrentWalker, mPlan
 
Constructor Summary
protected LOVisitor(LogicalPlan plan, PlanWalker<LogicalOperator,LogicalPlan> walker)
           
 
Method Summary
protected  void visit(BinaryExpressionOperator binOp)
           
protected  void visit(ExpressionOperator eOp)
           
protected  void visit(LOAdd op)
           
protected  void visit(LOAnd binOp)
           
protected  void visit(LOBinCond binCond)
           
protected  void visit(LOCast cast)
           
protected  void visit(LOCogroup cg)
           
protected  void visit(LOConst store)
           
protected  void visit(LOCross cs)
           
protected  void visit(LODistinct dt)
           
protected  void visit(LODivide op)
           
protected  void visit(LOEqual op)
           
protected  void visit(LOFilter filter)
           
protected  void visit(LOForEach forEach)
           
protected  void visit(LOGenerate g)
           
protected  void visit(LogicalOperator lOp)
           
protected  void visit(LOGreaterThan op)
           
protected  void visit(LOGreaterThanEqual op)
           
protected  void visit(LOIsNull uniOp)
           
protected  void visit(LOJoin loj)
           
protected  void visit(LOLesserThan op)
           
protected  void visit(LOLesserThanEqual op)
           
protected  void visit(LOLimit limOp)
           
protected  void visit(LOLoad load)
           
protected  void visit(LOMapLookup op)
           
protected  void visit(LOMod op)
           
protected  void visit(LOMultiply op)
           
protected  void visit(LONative loNative)
           
protected  void visit(LONegative op)
           
protected  void visit(LONot uniOp)
           
protected  void visit(LONotEqual op)
           
protected  void visit(LOOr binOp)
           
protected  void visit(LOProject project)
           
protected  void visit(LORegexp regexp)
           
protected  void visit(LOSort s)
           
protected  void visit(LOSplit split)
           
protected  void visit(LOSplitOutput sop)
           
protected  void visit(LOStore store)
           
protected  void visit(LOStream stream)
           
protected  void visit(LOSubtract op)
           
protected  void visit(LOUnion u)
           
protected  void visit(LOUserFunc func)
          Iterate over each expression that is part of the function argument list
protected  void visit(UnaryExpressionOperator uniOp)
           
 
Methods inherited from class org.apache.pig.impl.plan.PlanVisitor
getPlan, popWalker, pushWalker, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LOVisitor

protected LOVisitor(LogicalPlan plan,
                    PlanWalker<LogicalOperator,LogicalPlan> walker)
Method Detail

visit

protected void visit(LogicalOperator lOp)
              throws VisitorException
Parameters:
lOp - the logical operator that has to be visited
Throws:
VisitorException

visit

protected void visit(ExpressionOperator eOp)
              throws VisitorException
Parameters:
eOp - the logical expression operator that has to be visited
Throws:
VisitorException

visit

protected void visit(BinaryExpressionOperator binOp)
              throws VisitorException
Parameters:
binOp - the logical binary expression operator that has to be visited
Throws:
VisitorException

visit

protected void visit(UnaryExpressionOperator uniOp)
              throws VisitorException
Parameters:
uniOp - the logical unary operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOCogroup cg)
              throws VisitorException
Parameters:
cg - the logical cogroup operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOJoin loj)
              throws VisitorException
Parameters:
loj - the logical join operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOForEach forEach)
              throws VisitorException
Parameters:
forEach - the logical foreach operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOSort s)
              throws VisitorException
Parameters:
s - the logical sort operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOLimit limOp)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOStream stream)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOFilter filter)
              throws VisitorException
Parameters:
filter - the logical filter operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOSplit split)
              throws VisitorException
Parameters:
split - the logical split operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOGenerate g)
              throws VisitorException
Parameters:
g - the logical generate operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOUserFunc func)
              throws VisitorException
Iterate over each expression that is part of the function argument list

Parameters:
func - the user defined function
Throws:
VisitorException

visit

protected void visit(LOBinCond binCond)
              throws VisitorException
Parameters:
binCond - the logical binCond operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LOCast cast)
              throws VisitorException
Parameters:
cast - the logical cast operator that has to be visited
Throws:
VisitorException

visit

protected void visit(LORegexp regexp)
              throws VisitorException
Parameters:
regexp - the logical regexp operator that has to be visited
Throws:
ParseException
VisitorException

visit

protected void visit(LOLoad load)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LONative loNative)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOStore store)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOConst store)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOUnion u)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOSplitOutput sop)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LODistinct dt)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOCross cs)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOProject project)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOGreaterThan op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOLesserThan op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOGreaterThanEqual op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOLesserThanEqual op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOEqual op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LONotEqual op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOAdd op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOSubtract op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOMultiply op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LODivide op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOMod op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LONegative op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOMapLookup op)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOAnd binOp)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOOr binOp)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LONot uniOp)
              throws VisitorException
Throws:
VisitorException

visit

protected void visit(LOIsNull uniOp)
              throws VisitorException
Throws:
VisitorException


Copyright © ${year} The Apache Software Foundation