org.apache.pig.experimental.logical.expression
Class ConstantExpression
java.lang.Object
org.apache.pig.experimental.plan.Operator
org.apache.pig.experimental.logical.expression.LogicalExpression
org.apache.pig.experimental.logical.expression.ColumnExpression
org.apache.pig.experimental.logical.expression.ConstantExpression
public class ConstantExpression
- extends ColumnExpression
A constant
ConstantExpression
public ConstantExpression(OperatorPlan plan,
byte type,
Object val)
- Adds expression to the plan
- Parameters:
plan
- LogicalExpressionPlan this constant is a part of.type
- type of the constant. This could be determined dynamically,
but it would require a long chain of instanceofs, and the parser will
already know the type, so there's no reason to take the performance hit.val
- Value of this constant.
accept
public void accept(PlanVisitor v)
throws IOException
- 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:
IOException
getValue
public Object getValue()
- Get the value of this constant.
- Returns:
- value of the constant
isEqual
public boolean isEqual(Operator other)
- 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
Copyright © ${year} The Apache Software Foundation