org.apache.pig.newplan.logical.expression
Class LogicalExpression
java.lang.Object
org.apache.pig.newplan.Operator
org.apache.pig.newplan.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.
fieldSchema
protected LogicalSchema.LogicalFieldSchema fieldSchema
uidOnlyFieldSchema
protected LogicalSchema.LogicalFieldSchema uidOnlyFieldSchema
LogicalExpression
public LogicalExpression(String name,
OperatorPlan plan)
- Parameters:
name
- of the operatorplan
- LogicalExpressionPlan this is part of
getNextUid
public static long getNextUid()
resetNextUid
public static void resetNextUid()
getFieldSchema
public abstract LogicalSchema.LogicalFieldSchema getFieldSchema()
throws FrontendException
- Get the field schema for the output of this expression operator. This does
not merely return the field schema variable. If schema is not yet set, this
will attempt to construct it. Therefore it is abstract since each
operator will need to construct its field schema differently.
- Returns:
- the FieldSchema
- Throws:
FrontendException
resetFieldSchema
public void resetFieldSchema()
getType
public byte getType()
throws FrontendException
- Get the data type for this expression.
- Returns:
- data type, one of the static bytes of DataType
- Throws:
FrontendException
toString
public String toString()
- Overrides:
toString
in class Object
neverUseForRealSetFieldSchema
public void neverUseForRealSetFieldSchema(LogicalSchema.LogicalFieldSchema fs)
throws FrontendException
- Throws:
FrontendException
deepCopy
public abstract LogicalExpression deepCopy(LogicalExpressionPlan lgExpPlan)
throws FrontendException
- Create the deep copy of this expression and add that into the passed
LogicalExpressionPlan Return the copy of this expression with updated
logical expression plan.
- Parameters:
lgExpPlan
- LogicalExpressionPlan in which this expression will be added.
- Returns:
- LogicalExpression with its own logical expression plan.
- Throws:
IOException.
FrontendException
resetUid
public void resetUid()
- Erase all cached uid, regenerate uid when we regenerating schema.
This process currently only used in ImplicitSplitInsert, which will
insert split and invalidate some uids in plan
Copyright © 2012 The Apache Software Foundation