org.apache.pig.backend.hadoop.executionengine.physicalLayer
Class LogToPhyTranslationVisitor

java.lang.Object
  extended by org.apache.pig.impl.plan.PlanVisitor<LogicalOperator,LogicalPlan>
      extended by org.apache.pig.impl.logicalLayer.LOVisitor
          extended by org.apache.pig.backend.hadoop.executionengine.physicalLayer.LogToPhyTranslationVisitor
Direct Known Subclasses:
LocalLogToPhyTranslationVisitor

public class LogToPhyTranslationVisitor
extends LOVisitor


Field Summary
protected  PhysicalPlan currentPlan
           
protected  Stack<PhysicalPlan> currentPlans
           
protected  Map<LogicalOperator,PhysicalOperator> LogToPhyMap
           
protected  NodeIdGenerator nodeGen
           
protected  PigContext pc
           
 
Fields inherited from class org.apache.pig.impl.plan.PlanVisitor
mCurrentWalker, mPlan
 
Constructor Summary
LogToPhyTranslationVisitor(LogicalPlan plan)
           
 
Method Summary
 PhysicalPlan getPhysicalPlan()
           
 void setPigContext(PigContext pc)
           
static void updateWithEmptyBagCheck(PhysicalPlan fePlan, LogicalOperator joinInput)
          updates plan with check for empty bag and if bag is empty to flatten a bag with as many null's as dictated by the schema
 void visit(LOAdd op)
           
 void visit(LOAnd op)
           
 void visit(LOBinCond op)
           
 void visit(LOCast op)
           
 void visit(LOCogroup cg)
           
 void visit(LOConst op)
           
protected  void visit(LOCross cs)
           
 void visit(LODistinct op)
           
 void visit(LODivide op)
           
 void visit(LOEqual op)
           
 void visit(LOFilter filter)
           
 void visit(LOForEach g)
           
 void visit(LOGreaterThan op)
           
 void visit(LOGreaterThanEqual op)
           
 void visit(LOIsNull op)
           
protected  void visit(LOJoin loj)
           
 void visit(LOLesserThan op)
           
 void visit(LOLesserThanEqual op)
           
 void visit(LOLimit limit)
           
 void visit(LOLoad loLoad)
           
 void visit(LOMapLookup op)
           
 void visit(LOMod op)
           
 void visit(LOMultiply op)
           
 void visit(LONegative op)
           
 void visit(LONot op)
           
 void visit(LONotEqual op)
           
 void visit(LOOr op)
           
 void visit(LOProject op)
           
 void visit(LORegexp op)
           
 void visit(LOSort s)
           
 void visit(LOSplit split)
           
 void visit(LOSplitOutput split)
           
 void visit(LOStore loStore)
           
 void visit(LOStream stream)
           
 void visit(LOSubtract op)
           
 void visit(LOUnion op)
           
 void visit(LOUserFunc func)
          Iterate over each expression that is part of the function argument list
 
Methods inherited from class org.apache.pig.impl.logicalLayer.LOVisitor
visit, visit, visit, visit, visit
 
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
 

Field Detail

LogToPhyMap

protected Map<LogicalOperator,PhysicalOperator> LogToPhyMap

currentPlans

protected Stack<PhysicalPlan> currentPlans

currentPlan

protected PhysicalPlan currentPlan

nodeGen

protected NodeIdGenerator nodeGen

pc

protected PigContext pc
Constructor Detail

LogToPhyTranslationVisitor

public LogToPhyTranslationVisitor(LogicalPlan plan)
Method Detail

setPigContext

public void setPigContext(PigContext pc)

getPhysicalPlan

public PhysicalPlan getPhysicalPlan()

visit

public void visit(LOGreaterThan op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOLesserThan op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOGreaterThanEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOLesserThanEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LONotEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LORegexp op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
op - the logical regexp operator that has to be visited
Throws:
VisitorException

visit

public void visit(LOAdd op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOSubtract op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOMultiply op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LODivide op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOMod op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOAnd op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOOr op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LONot op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

protected void visit(LOCross cs)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOCogroup cg)
           throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
cg - the logical cogroup operator that has to be visited
Throws:
VisitorException

visit

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

updateWithEmptyBagCheck

public static void updateWithEmptyBagCheck(PhysicalPlan fePlan,
                                           LogicalOperator joinInput)
                                    throws PlanException,
                                           LogicalToPhysicalTranslatorException
updates plan with check for empty bag and if bag is empty to flatten a bag with as many null's as dictated by the schema

Parameters:
fePlan - the plan to update
joinInput - the relation for which the corresponding bag is being checked
Throws:
PlanException
LogicalToPhysicalTranslatorException

visit

public void visit(LOFilter filter)
           throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
filter - the logical filter operator that has to be visited
Throws:
VisitorException

visit

public void visit(LOStream stream)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOProject op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOForEach g)
           throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
g - the logical foreach operator that has to be visited
Throws:
VisitorException

visit

public void visit(LOSort s)
           throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
s - the logical sort operator that has to be visited
Throws:
VisitorException

visit

public void visit(LODistinct op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOSplit split)
           throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
split - the logical split operator that has to be visited
Throws:
VisitorException

visit

public void visit(LOSplitOutput split)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOUserFunc func)
           throws VisitorException
Description copied from class: LOVisitor
Iterate over each expression that is part of the function argument list

Overrides:
visit in class LOVisitor
Parameters:
func - the user defined function
Throws:
VisitorException

visit

public void visit(LOLoad loLoad)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOStore loStore)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOConst op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOBinCond op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
op - the logical binCond operator that has to be visited
Throws:
VisitorException

visit

public void visit(LONegative op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOIsNull op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOMapLookup op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOCast op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
op - the logical cast operator that has to be visited
Throws:
VisitorException

visit

public void visit(LOLimit limit)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

public void visit(LOUnion op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException


Copyright © ${year} The Apache Software Foundation