org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators
Class BinaryComparisonOperator

java.lang.Object
  extended by org.apache.pig.impl.plan.Operator<PhyPlanVisitor>
      extended by org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator
          extended by org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ExpressionOperator
              extended by org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.BinaryExpressionOperator
                  extended by org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.BinaryComparisonOperator
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Operator>, ComparisonOperator, Illustrable
Direct Known Subclasses:
EqualToExpr, GreaterThanExpr, GTOrEqualToExpr, LessThanExpr, LTOrEqualToExpr, NotEqualToExpr, POAnd, POOr, PORegexp

public abstract class BinaryComparisonOperator
extends BinaryExpressionOperator
implements ComparisonOperator

This is a base class for all binary comparison operators. Supports the use of operand type instead of result type as the result type is always boolean. All comparison operators fetch the lhs and rhs operands and compare them for each type using different comparison methods based on what comparison is being implemented.

See Also:
Serialized Form

Field Summary
protected  Boolean falseRef
           
protected  byte operandType
           
protected  Boolean trueRef
           
 
Fields inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.BinaryExpressionOperator
lhs, rhs
 
Fields inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator
alias, dummyBag, dummyBool, dummyDBA, dummyDouble, dummyFloat, dummyInt, dummyLong, dummyMap, dummyString, dummyTuple, illustrator, input, inputAttached, inputs, lineageTracer, outputs, parentPlan, pigLogger, reporter, requestedParallelism, res, resultType
 
Fields inherited from class org.apache.pig.impl.plan.Operator
mKey
 
Constructor Summary
BinaryComparisonOperator(OperatorKey k)
           
BinaryComparisonOperator(OperatorKey k, int rp)
           
 
Method Summary
protected  void cloneHelper(BinaryComparisonOperator op)
           
 byte getOperandType()
          Determine the type of the operand(s) of this comparator.
 Tuple illustratorMarkup(Object in, Object out, int eqClassIndex)
          input tuple mark up to be illustrate-able
protected  void initializeRefs()
           
 void setOperandType(byte operandType)
          Set the type of the operand(s) of this comparator.
 
Methods inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.BinaryExpressionOperator
cloneHelper, getChildExpressions, getLhs, getRhs, setLhs, setRhs, supportsMultipleInputs
 
Methods inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ExpressionOperator
accumChild, accumChild, accumChild, accumChild, accumChild, accumChild, accumChild, accumChild, accumChild, accumChild, accumChild, clone, containUDF, getNext, setIllustrator, supportsMultipleOutputs, visit
 
Methods inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator
attachInput, cloneHelper, detachInput, getAlias, getAliasString, getDummy, getIllustrator, getInputs, getLogger, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getPigLogger, getRequestedParallelism, getResultType, isAccumStarted, isAccumulative, isBlocking, isInputAttached, processInput, reset, setAccumEnd, setAccumStart, setAccumulative, setAlias, setInputs, setParentPlan, setPigLogger, setReporter, setRequestedParallelism, setResultType
 
Methods inherited from class org.apache.pig.impl.plan.Operator
compareTo, equals, getOperatorKey, getProjectionMap, hashCode, name, regenerateProjectionMap, rewire, toString, unsetProjectionMap
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ComparisonOperator
getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext
 

Field Detail

operandType

protected byte operandType

trueRef

protected Boolean trueRef

falseRef

protected Boolean falseRef
Constructor Detail

BinaryComparisonOperator

public BinaryComparisonOperator(OperatorKey k)

BinaryComparisonOperator

public BinaryComparisonOperator(OperatorKey k,
                                int rp)
Method Detail

getOperandType

public byte getOperandType()
Description copied from interface: ComparisonOperator
Determine the type of the operand(s) of this comparator.

Specified by:
getOperandType in interface ComparisonOperator
Returns:
type, as a byte (using DataType types).

setOperandType

public void setOperandType(byte operandType)
Description copied from interface: ComparisonOperator
Set the type of the operand(s) of this comparator.

Specified by:
setOperandType in interface ComparisonOperator
Parameters:
operandType - Type of the operand(s), as a byte (using DataType types).

initializeRefs

protected void initializeRefs()

cloneHelper

protected void cloneHelper(BinaryComparisonOperator op)

illustratorMarkup

public Tuple illustratorMarkup(Object in,
                               Object out,
                               int eqClassIndex)
Description copied from interface: Illustrable
input tuple mark up to be illustrate-able

Specified by:
illustratorMarkup in interface Illustrable
Overrides:
illustratorMarkup in class BinaryExpressionOperator
Parameters:
in - input tuple
out - output tuple before wrapped in ExampleTuple
eqClassIndex - index into equivalence classes in illustrator
Returns:
tuple


Copyright © ${year} The Apache Software Foundation