org.apache.pig.newplan.logical.expression
Class DereferenceExpression
java.lang.Object
org.apache.pig.newplan.Operator
org.apache.pig.newplan.logical.expression.LogicalExpression
org.apache.pig.newplan.logical.expression.ColumnExpression
org.apache.pig.newplan.logical.expression.DereferenceExpression
public class DereferenceExpression
- extends ColumnExpression
get one or elements out of a tuple or a bag
in case of Tuple( a#2:int, b#3:bag{ b_a#4:int, b_b#5:float }, c#6:int ) # 1
(the number after # represents the uid)
Dereference ( 0 ) --> a:int
- dereference of single column in a tuple gives the field
Dereference ( 0,2 ) --> Tuple(a#2:int, c#6:int) #7
- dereference of more than one column gives a tuple
Dereference ( 1 ) --> Dereference ( 1 ) --> b:bag{b_b#5:float}#8
- dereference of a bag gives a bag
DereferenceExpression
public DereferenceExpression(OperatorPlan plan)
DereferenceExpression
public DereferenceExpression(OperatorPlan plan,
int colNum)
DereferenceExpression
public DereferenceExpression(OperatorPlan plan,
List<Integer> columnNums)
setRawColumns
public void setRawColumns(List<Object> cols)
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
getBagColumns
public List<Integer> getBagColumns()
setBagColumns
public void setBagColumns(List<Integer> columns)
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
getReferredExpression
public LogicalExpression getReferredExpression()
throws FrontendException
- Throws:
FrontendException
toString
public String toString()
- Overrides:
toString
in class LogicalExpression
getFieldSchema
public LogicalSchema.LogicalFieldSchema getFieldSchema()
throws FrontendException
- Description copied from class:
LogicalExpression
- 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.
- Specified by:
getFieldSchema
in class LogicalExpression
- Returns:
- the FieldSchema
- Throws:
FrontendException
deepCopy
public LogicalExpression deepCopy(LogicalExpressionPlan lgExpPlan)
throws FrontendException
- Description copied from class:
LogicalExpression
- 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.
- Specified by:
deepCopy
in class LogicalExpression
- Parameters:
lgExpPlan
- LogicalExpressionPlan in which this expression will be added.
- Returns:
- LogicalExpression with its own logical expression plan.
- Throws:
FrontendException
getRawColumns
public List<Object> getRawColumns()
Copyright © 2012 The Apache Software Foundation