org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators
Class POLocalRearrange

java.lang.Object
  extended by org.apache.pig.impl.plan.Operator<PhyPlanVisitor>
      extended by org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator
          extended by org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLocalRearrange
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Operator>
Direct Known Subclasses:
POLocalRearrangeForIllustrate, POPartitionRearrange

public class POLocalRearrange
extends PhysicalOperator

The local rearrange operator is a part of the co-group implementation. It has an embedded physical plan that generates tuples of the form (grpKey,(indxed inp Tuple)).

See Also:
Serialized Form

Field Summary
protected  byte index
           
protected  boolean isCross
           
protected  byte keyType
           
protected  List<ExpressionOperator> leafOps
           
protected  byte mainKeyType
           
protected  Tuple mFakeTuple
           
protected  boolean mIsDistinct
           
protected static TupleFactory mTupleFactory
           
protected  List<PhysicalPlan> plans
           
protected  byte secondaryKeyType
           
protected  List<ExpressionOperator> secondaryLeafOps
           
protected  List<PhysicalPlan> secondaryPlans
           
protected static long serialVersionUID
           
 
Fields inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator
alias, dummyBag, dummyBool, dummyDBA, dummyDouble, dummyFloat, dummyInt, dummyLong, dummyMap, dummyString, dummyTuple, input, inputAttached, inputs, lineageTracer, outputs, parentPlan, pigLogger, reporter, requestedParallelism, res, resultType
 
Fields inherited from class org.apache.pig.impl.plan.Operator
mKey
 
Constructor Summary
POLocalRearrange(OperatorKey k)
           
POLocalRearrange(OperatorKey k, int rp)
           
POLocalRearrange(OperatorKey k, int rp, List<PhysicalOperator> inp)
           
POLocalRearrange(OperatorKey k, List<PhysicalOperator> inp)
           
 
Method Summary
 void attachInput(Tuple t)
          Overridden since the attachment of the new input should cause the old processing to end.
 POLocalRearrange clone()
          Make a deep copy of this operator.
protected  Tuple constructLROutput(List<Result> resLst, List<Result> secondaryResLst, Tuple value)
           
 byte getIndex()
           
protected  Object getKeyFromResult(List<Result> resLst, byte type)
           
 byte getKeyType()
           
 Result getNext(Tuple t)
          Calls getNext on the generate operator inside the nested physical plan.
 List<PhysicalPlan> getPlans()
           
 Map<Integer,Integer> getProjectedColsMap()
           
 Map<Integer,Integer> getSecondaryProjectedColsMap()
           
 boolean isCross()
           
 boolean isDistinct()
           
 boolean isKeyTuple()
           
 boolean isProjectStar()
           
 boolean isSecondaryKeyTuple()
           
 boolean isSecondaryProjectStar()
           
 String name()
           
 void setCross(boolean isCross)
           
 void setDistinct(boolean isDistinct)
           
 void setIndex(int index)
          Sets the co-group index of this operator
 void setKeyType(byte keyType)
           
 void setMultiQueryIndex(int index)
          Sets the multi-query index of this operator
 void setPlans(List<PhysicalPlan> plans)
           
 void setPlansFromCombiner(List<PhysicalPlan> plans)
           
 void setSecondaryPlans(List<PhysicalPlan> plans)
           
protected  void setStripKeyFromValue(boolean stripKeyFromValue)
           
 void setUseSecondaryKey(boolean useSecondaryKey)
           
 boolean supportsMultipleInputs()
          Indicates whether this operator supports multiple inputs.
 boolean supportsMultipleOutputs()
          Indicates whether this operator supports multiple outputs.
 void visit(PhyPlanVisitor v)
          Visit this node with the provided visitor.
 
Methods inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator
cloneHelper, detachInput, getAlias, getAliasString, getInputs, getLogger, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getPigLogger, getRequestedParallelism, getResultType, isAccumStarted, isAccumulative, isBlocking, isInputAttached, processInput, reset, setAccumEnd, setAccumStart, setAccumulative, setAlias, setInputs, setLineageTracer, setParentPlan, setPigLogger, setReporter, setRequestedParallelism, setResultType
 
Methods inherited from class org.apache.pig.impl.plan.Operator
compareTo, equals, getOperatorKey, getProjectionMap, hashCode, regenerateProjectionMap, rewire, toString, unsetProjectionMap
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
See Also:
Constant Field Values

mTupleFactory

protected static final TupleFactory mTupleFactory

plans

protected List<PhysicalPlan> plans

secondaryPlans

protected List<PhysicalPlan> secondaryPlans

leafOps

protected List<ExpressionOperator> leafOps

secondaryLeafOps

protected List<ExpressionOperator> secondaryLeafOps

index

protected byte index

keyType

protected byte keyType

mainKeyType

protected byte mainKeyType

secondaryKeyType

protected byte secondaryKeyType

mIsDistinct

protected boolean mIsDistinct

isCross

protected boolean isCross

mFakeTuple

protected Tuple mFakeTuple
Constructor Detail

POLocalRearrange

public POLocalRearrange(OperatorKey k)

POLocalRearrange

public POLocalRearrange(OperatorKey k,
                        int rp)

POLocalRearrange

public POLocalRearrange(OperatorKey k,
                        List<PhysicalOperator> inp)

POLocalRearrange

public POLocalRearrange(OperatorKey k,
                        int rp,
                        List<PhysicalOperator> inp)
Method Detail

visit

public void visit(PhyPlanVisitor v)
           throws VisitorException
Description copied from class: Operator
Visit this node with the provided visitor. This should only be called by the visitor class itself, never directly.

Specified by:
visit in class PhysicalOperator
Parameters:
v - Visitor to visit with.
Throws:
VisitorException - if the visitor has a problem.

name

public String name()
Specified by:
name in class Operator<PhyPlanVisitor>

supportsMultipleInputs

public boolean supportsMultipleInputs()
Description copied from class: Operator
Indicates whether this operator supports multiple inputs.

Specified by:
supportsMultipleInputs in class Operator<PhyPlanVisitor>
Returns:
true if it does, otherwise false.

supportsMultipleOutputs

public boolean supportsMultipleOutputs()
Description copied from class: Operator
Indicates whether this operator supports multiple outputs.

Specified by:
supportsMultipleOutputs in class Operator<PhyPlanVisitor>
Returns:
true if it does, otherwise false.

getIndex

public byte getIndex()

setIndex

public void setIndex(int index)
              throws ExecException
Sets the co-group index of this operator

Parameters:
index - the position of this operator in a co-group operation
Throws:
ExecException - if the index value is bigger then 0x7F

setMultiQueryIndex

public void setMultiQueryIndex(int index)
                        throws ExecException
Sets the multi-query index of this operator

Parameters:
index - the position of the parent plan of this operator in the enclosed split operator
Throws:
ExecException - if the index value is bigger then 0x7F

isDistinct

public boolean isDistinct()

setDistinct

public void setDistinct(boolean isDistinct)

attachInput

public void attachInput(Tuple t)
Overridden since the attachment of the new input should cause the old processing to end.

Overrides:
attachInput in class PhysicalOperator
Parameters:
t - - The tuple that should be used as input

getNext

public Result getNext(Tuple t)
               throws ExecException
Calls getNext on the generate operator inside the nested physical plan. Converts the generated tuple into the proper format, i.e, (key,indexedTuple(value))

Overrides:
getNext in class PhysicalOperator
Throws:
ExecException

getKeyFromResult

protected Object getKeyFromResult(List<Result> resLst,
                                  byte type)
                           throws ExecException
Throws:
ExecException

constructLROutput

protected Tuple constructLROutput(List<Result> resLst,
                                  List<Result> secondaryResLst,
                                  Tuple value)
                           throws ExecException
Throws:
ExecException

getKeyType

public byte getKeyType()

setKeyType

public void setKeyType(byte keyType)

getPlans

public List<PhysicalPlan> getPlans()

setUseSecondaryKey

public void setUseSecondaryKey(boolean useSecondaryKey)

setPlans

public void setPlans(List<PhysicalPlan> plans)
              throws PlanException
Throws:
PlanException

setSecondaryPlans

public void setSecondaryPlans(List<PhysicalPlan> plans)
                       throws PlanException
Throws:
PlanException

clone

public POLocalRearrange clone()
                       throws CloneNotSupportedException
Make a deep copy of this operator.

Overrides:
clone in class PhysicalOperator
Throws:
CloneNotSupportedException
See Also:
Do not use the clone method directly. Operators are cloned when logical plans are cloned using {@link LogicalPlanCloner}

isCross

public boolean isCross()

setCross

public void setCross(boolean isCross)

getProjectedColsMap

public Map<Integer,Integer> getProjectedColsMap()
Returns:
the mProjectedColsMap

getSecondaryProjectedColsMap

public Map<Integer,Integer> getSecondaryProjectedColsMap()
Returns:
the mProjectedColsMap

isProjectStar

public boolean isProjectStar()
Returns:
the mProjectStar

isSecondaryProjectStar

public boolean isSecondaryProjectStar()
Returns:
the mProjectStar

isKeyTuple

public boolean isKeyTuple()
Returns:
the keyTuple

isSecondaryKeyTuple

public boolean isSecondaryKeyTuple()
Returns:
the keyTuple

setPlansFromCombiner

public void setPlansFromCombiner(List<PhysicalPlan> plans)
                          throws PlanException
Parameters:
plans -
Throws:
ExecException
PlanException

setStripKeyFromValue

protected void setStripKeyFromValue(boolean stripKeyFromValue)


Copyright © ${year} The Apache Software Foundation