org.apache.pig.experimental.logical.expression
Class LogicalExpression

java.lang.Object
  extended by org.apache.pig.experimental.plan.Operator
      extended by org.apache.pig.experimental.logical.expression.LogicalExpression
Direct Known Subclasses:
BinaryExpression, BinCondExpression, ColumnExpression, UnaryExpression, UserFuncExpression

public abstract class LogicalExpression
extends Operator

Logical representation of expression operators. Expression operators have a data type and a uid. Uid is a unique id for each expression.


Field Summary
protected  byte type
           
protected  long uid
           
 
Fields inherited from class org.apache.pig.experimental.plan.Operator
annotations, hashPrime, name, plan
 
Constructor Summary
LogicalExpression(String name, OperatorPlan plan, byte b)
           
 
Method Summary
static long getNextUid()
           
 byte getType()
          Get the data type for this expression.
 long getUid()
          Get the unique identifier for this expression
 void neverUseForRealSetUid(long uid)
          Hard code the uid.
static void resetNextUid()
           
 void setUid(LogicalRelationalOperator currentOp)
          Set the uid.
 String toString()
           
 
Methods inherited from class org.apache.pig.experimental.plan.Operator
accept, annotate, getAnnotation, getName, getPlan, isEqual, removeAnnotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected byte type

uid

protected long uid
Constructor Detail

LogicalExpression

public LogicalExpression(String name,
                         OperatorPlan plan,
                         byte b)
Parameters:
name - of the operator
plan - LogicalExpressionPlan this is part of
b - datatype of this expression
Method Detail

getNextUid

public static long getNextUid()

resetNextUid

public static void resetNextUid()

getType

public byte getType()
Get the data type for this expression.

Returns:
data type, one of the static bytes of DataType

getUid

public long getUid()
Get the unique identifier for this expression

Returns:
unique identifier

setUid

public void setUid(LogicalRelationalOperator currentOp)
            throws IOException
Set the uid. For most expressions this will get a new uid. ProjectExpression needs to override this and find its uid from its predecessor.

Parameters:
currentOp - Current LogicalRelationalOperator that this expression operator is attached to. Passed so that projection operators can determine their uid.
Throws:
IOException

neverUseForRealSetUid

public void neverUseForRealSetUid(long uid)
Hard code the uid. This should only be used in testing, never in real code.

Parameters:
uid - value to set uid to

toString

public String toString()
Overrides:
toString in class Object


Copyright © ${year} The Apache Software Foundation