org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators
Class POSort
java.lang.Object
org.apache.pig.impl.plan.Operator<PhyPlanVisitor>
org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator
org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSort
- All Implemented Interfaces:
- Serializable, Cloneable, Comparable<Operator>
public class POSort
- extends PhysicalOperator
This implementation is applicable for both the physical plan and for the
local backend, as the conversion of physical to mapreduce would see the SORT
operator and take necessary steps to convert it to a quantile and a sort job.
This is a blocking operator. The sortedDataBag accumulates Tuples and sorts
them only when there an iterator is started. So all the tuples from the input
operator should be accumulated and filled into the dataBag. The attachInput
method is not applicable here.
- See Also:
- Serialized Form
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 |
Methods inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator |
attachInput, cloneHelper, detachInput, getAlias, getAliasString, getInputs, getLogger, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getPigLogger, getRequestedParallelism, getResultType, isAccumStarted, isAccumulative, isInputAttached, processInput, setAccumEnd, setAccumStart, setAccumulative, setAlias, setInputs, setLineageTracer, setParentPlan, setPigLogger, setReporter, setRequestedParallelism, setResultType |
isUDFComparatorUsed
public boolean isUDFComparatorUsed
POSort
public POSort(OperatorKey k,
int rp,
List inp,
List<PhysicalPlan> sortPlans,
List<Boolean> mAscCols,
POUserComparisonFunc mSortFunc)
POSort
public POSort(OperatorKey k,
int rp,
List inp)
POSort
public POSort(OperatorKey k,
int rp)
POSort
public POSort(OperatorKey k,
List inp)
POSort
public POSort(OperatorKey k)
name
public String name()
- Specified by:
name
in class Operator<PhyPlanVisitor>
isBlocking
public boolean isBlocking()
- Description copied from class:
PhysicalOperator
- A blocking operator should override this to return true. Blocking
operators are those that need the full bag before operate on the tuples
inside the bag. Example is the Global Rearrange. Non-blocking or pipeline
operators are those that work on a tuple by tuple basis.
- Overrides:
isBlocking
in class PhysicalOperator
- Returns:
- true if blocking and false otherwise
getNext
public Result getNext(Tuple t)
throws ExecException
- Overrides:
getNext
in class PhysicalOperator
- Throws:
ExecException
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.
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.
reset
public void reset()
- Description copied from class:
PhysicalOperator
- Reset internal state in an operator. For use in nested pipelines
where operators like limit and sort may need to reset their state.
Limit needs it because it needs to know it's seeing a fresh set of
input. Blocking operators like sort and distinct need it because they
may not have drained their previous input due to a limit and thus need
to be told to drop their old input and start over.
- Overrides:
reset
in class PhysicalOperator
getSortPlans
public List<PhysicalPlan> getSortPlans()
setSortPlans
public void setSortPlans(List<PhysicalPlan> sortPlans)
getMSortFunc
public POUserComparisonFunc getMSortFunc()
setMSortFunc
public void setMSortFunc(POUserComparisonFunc sortFunc)
getMAscCols
public List<Boolean> getMAscCols()
setLimit
public void setLimit(long l)
getLimit
public long getLimit()
isLimited
public boolean isLimited()
clone
public POSort clone()
throws CloneNotSupportedException
- Description copied from class:
PhysicalOperator
- Make a deep copy of this operator. This function is blank, however,
we should leave a place holder so that the subclasses can clone
- 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}
setSortInfo
public void setSortInfo(SortInfo sortInfo)
- Parameters:
sortInfo
- the sortInfo to set
getSortInfo
public SortInfo getSortInfo()
- Returns:
- the sortInfo
Copyright © ${year} The Apache Software Foundation