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
protected  void visit(LOAdd op)
           
protected  void visit(LOAnd op)
           
 void visit(LOBinCond op)
           
protected  void visit(LOCast op)
           
protected  void visit(LOCogroup cg)
           
protected  void visit(LOConst op)
           
protected  void visit(LOCross cs)
           
protected  void visit(LODistinct op)
           
protected  void visit(LODivide op)
           
protected  void visit(LOEqual op)
           
protected  void visit(LOFilter filter)
           
protected  void visit(LOForEach g)
           
protected  void visit(LOGreaterThan op)
           
protected  void visit(LOGreaterThanEqual op)
           
protected  void visit(LOIsNull op)
           
protected  void visit(LOJoin loj)
           
protected  void visit(LOLesserThan op)
           
protected  void visit(LOLesserThanEqual op)
           
protected  void visit(LOLimit limit)
           
protected  void visit(LOLoad loLoad)
           
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 op)
           
protected  void visit(LONotEqual op)
           
protected  void visit(LOOr op)
           
protected  void visit(LOProject op)
           
protected  void visit(LORegexp op)
           
protected  void visit(LOSort s)
           
protected  void visit(LOSplit split)
           
protected  void visit(LOSplitOutput split)
           
protected  void visit(LOStore loStore)
           
protected  void visit(LOStream stream)
           
protected  void visit(LOSubtract op)
           
protected  void visit(LOUnion op)
           
protected  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

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

protected 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

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

protected 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

protected 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

protected 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

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

visit

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

visit

protected 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

protected 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

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

visit

protected 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

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

visit

protected 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

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

visit

protected void visit(LONative loNative)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException

visit

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

visit

protected 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

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

visit

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

visit

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

visit

protected 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

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

visit

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


Copyright © ${year} The Apache Software Foundation