org.apache.pig.impl.logicalLayer
Class LOSort

java.lang.Object
  extended by org.apache.pig.impl.plan.Operator<LOVisitor>
      extended by org.apache.pig.impl.logicalLayer.LogicalOperator
          extended by org.apache.pig.impl.logicalLayer.LOSort
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Operator>

public class LOSort
extends LogicalOperator

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.pig.impl.logicalLayer.LogicalOperator
mAlias, mIsSchemaComputed, mPlan, mRequestedParallelism, mSchema, mType
 
Fields inherited from class org.apache.pig.impl.plan.Operator
mKey
 
Constructor Summary
LOSort(LogicalPlan plan, OperatorKey key, List<LogicalPlan> sortColPlans, List<Boolean> ascCols, FuncSpec sortFunc)
           
 
Method Summary
protected  Object clone()
           
 List<Boolean> getAscendingCols()
           
 LogicalOperator getInput()
           
 long getLimit()
           
 ProjectionMap getProjectionMap()
          Produce a map describing how this operator modifies its projection.
 List<RequiredFields> getRequiredFields()
          Get a list of fields that this operator requires.
 Schema getSchema()
          Get a copy of the schema for the output of this operator.
 List<LogicalPlan> getSortColPlans()
           
 byte getType()
          Get the type of this operator.
 FuncSpec getUserFunc()
           
 boolean isLimited()
           
 boolean isStar()
           
 String name()
           
 void setAscendingCols(List<Boolean> ascCols)
           
 void setLimit(long l)
           
 void setSortColPlans(List<LogicalPlan> sortPlans)
           
 void setStar(boolean b)
           
 void setUserFunc(FuncSpec func)
           
 boolean supportsMultipleInputs()
          Indicates whether this operator supports multiple inputs.
 void visit(LOVisitor v)
          Visit this node with the provided visitor.
 
Methods inherited from class org.apache.pig.impl.logicalLayer.LogicalOperator
forceSchema, getAlias, getOperatorKey, getPlan, getRequestedParallelism, reconcileSchema, regenerateSchema, setAlias, setCanonicalNames, setPlan, setRequestedParallelism, setSchema, setSchemaComputed, setType, supportsMultipleOutputs, toString, unsetSchema
 
Methods inherited from class org.apache.pig.impl.plan.Operator
compareTo, equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LOSort

public LOSort(LogicalPlan plan,
              OperatorKey key,
              List<LogicalPlan> sortColPlans,
              List<Boolean> ascCols,
              FuncSpec sortFunc)
Parameters:
plan - LogicalPlan this operator is a part of.
key - OperatorKey for this operator
sortColPlans - Array of column numbers that will be used for sorting data.
ascCols - Array of booleans. Should be same size as sortCols. True indicates sort ascending (default), false sort descending. If this array is null, then all columns will be sorted ascending.
sortFunc - the user defined sorting function
Method Detail

getInput

public LogicalOperator getInput()

getSortColPlans

public List<LogicalPlan> getSortColPlans()

setSortColPlans

public void setSortColPlans(List<LogicalPlan> sortPlans)

getAscendingCols

public List<Boolean> getAscendingCols()

setAscendingCols

public void setAscendingCols(List<Boolean> ascCols)

getUserFunc

public FuncSpec getUserFunc()

setUserFunc

public void setUserFunc(FuncSpec func)

isStar

public boolean isStar()

setStar

public void setStar(boolean b)

setLimit

public void setLimit(long l)

getLimit

public long getLimit()

isLimited

public boolean isLimited()

name

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

getSchema

public Schema getSchema()
                 throws FrontendException
Description copied from class: LogicalOperator
Get a copy of the schema for the output of this operator.

Specified by:
getSchema in class LogicalOperator
Throws:
FrontendException

supportsMultipleInputs

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

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

visit

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

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

getType

public byte getType()
Description copied from class: LogicalOperator
Get the type of this operator.

Overrides:
getType in class LogicalOperator

clone

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

getProjectionMap

public ProjectionMap getProjectionMap()
Description copied from class: LogicalOperator
Produce a map describing how this operator modifies its projection.

Overrides:
getProjectionMap in class LogicalOperator
Returns:
ProjectionMap null indicates it does not know how the projection changes, for example a join of two inputs where one input does not have a schema.

getRequiredFields

public List<RequiredFields> getRequiredFields()
Description copied from class: LogicalOperator
Get a list of fields that this operator requires. This is not necessarily equivalent to the list of fields the operator projects. For example, a filter will project anything passed to it, but requires only the fields explicitly referenced in its filter expression.

Overrides:
getRequiredFields in class LogicalOperator
Returns:
list of RequiredFields null indicates that the operator does not need any fields from its input.


Copyright © ${year} The Apache Software Foundation