org.apache.pig.newplan.logical.relational
Class LORank

java.lang.Object
  extended by org.apache.pig.newplan.Operator
      extended by org.apache.pig.newplan.logical.relational.LogicalRelationalOperator
          extended by org.apache.pig.newplan.logical.relational.LORank

public class LORank
extends LogicalRelationalOperator

RANK operator implementation. Operator Syntax:

 alias = RANK rel ( BY (col_ref) (ASC|DESC)? ( DENSE )? )?;
 alias - output alias
 RANK - operator
 rel - input relation
 BY - operator
 col_ref - STAR or Column References or a range in the schema of rel
 DENSE - dense rank means a sequential value without gasp among different tuple values.
 


Field Summary
 
Fields inherited from class org.apache.pig.newplan.logical.relational.LogicalRelationalOperator
alias, lineNum, mCustomPartitioner, mPinnedOptions, requestedParallelism, schema
 
Fields inherited from class org.apache.pig.newplan.Operator
annotations, hashPrime, location, name, plan
 
Constructor Summary
LORank(OperatorPlan plan)
           
LORank(OperatorPlan plan, List<LogicalExpressionPlan> rankColPlans, List<Boolean> ascCols)
           
 
Method Summary
 void accept(PlanVisitor v)
          Accept a visitor at this node in the graph.
 List<Boolean> getAscendingCol()
           
 List<LogicalExpressionPlan> getRankColPlans()
           
 LogicalSchema getSchema()
          Get the schema for the output of LORank.
 boolean isDenseRank()
          Get if it is a dense RANK BY
 boolean isEqual(Operator other)
          This is like a shallow equals comparison.
 boolean isRowNumber()
          Get if it is a simple RANK operation.
 void setAscendingCol(List<Boolean> ascCols)
           
 void setIsDenseRank(boolean isDenseRank)
          Set if it is a dense RANK BY
 void setIsRowNumber(boolean rowNumber)
          Set if it is a simple RANK operation.
 void setRankColPlan(List<LogicalExpressionPlan> rankColPlans)
           
 
Methods inherited from class org.apache.pig.newplan.logical.relational.LogicalRelationalOperator
checkEquality, fixDuplicateUids, getAlias, getCustomPartitioner, getLineNumber, getRequestedParallelism, isPinnedOption, neverUseForRealSetSchema, pinOption, resetSchema, resetUid, setAlias, setCustomPartitioner, setRequestedParallelism, setSchema, toString
 
Methods inherited from class org.apache.pig.newplan.Operator
annotate, getAnnotation, getLocation, getName, getPlan, removeAnnotation, setLocation, setPlan
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LORank

public LORank(OperatorPlan plan)

LORank

public LORank(OperatorPlan plan,
              List<LogicalExpressionPlan> rankColPlans,
              List<Boolean> ascCols)
Method Detail

getRankColPlans

public List<LogicalExpressionPlan> getRankColPlans()

setRankColPlan

public void setRankColPlan(List<LogicalExpressionPlan> rankColPlans)

getAscendingCol

public List<Boolean> getAscendingCol()

setAscendingCol

public void setAscendingCol(List<Boolean> ascCols)

getSchema

public LogicalSchema getSchema()
                        throws FrontendException
Get the schema for the output of LORank. Composed by long value prepended to the rest of the input schema

Specified by:
getSchema in class LogicalRelationalOperator
Returns:
the schema
Throws:
FrontendException

accept

public void accept(PlanVisitor v)
            throws FrontendException
Description copied from class: Operator
Accept a visitor at this node in the graph.

Specified by:
accept in class Operator
Parameters:
v - Visitor to accept.
Throws:
FrontendException

isEqual

public boolean isEqual(Operator other)
                throws FrontendException
Description copied from class: Operator
This is like a shallow equals comparison. It returns true if two operators have equivalent properties even if they are different objects. Here properties mean equivalent plan and equivalent name.

Specified by:
isEqual in class Operator
Returns:
true if two object have equivalent properties, else false
Throws:
FrontendException

isDenseRank

public boolean isDenseRank()
Get if it is a dense RANK BY

Returns:
boolean

setIsDenseRank

public void setIsDenseRank(boolean isDenseRank)
Set if it is a dense RANK BY

Parameters:
isDenseRank - if is dense rank or not

isRowNumber

public boolean isRowNumber()
Get if it is a simple RANK operation. Which means a row number attached to each tuple.

Returns:
boolean

setIsRowNumber

public void setIsRowNumber(boolean rowNumber)
Set if it is a simple RANK operation.

Parameters:
rowNumber - if is a row number operation


Copyright © 2007-2012 The Apache Software Foundation