org.apache.hadoop.hive.ql.exec
Class ExprNodeEvaluator<T extends ExprNodeDesc>

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator<T>
Direct Known Subclasses:
ExprNodeColumnEvaluator, ExprNodeConstantEvaluator, ExprNodeEvaluatorHead, ExprNodeEvaluatorRef, ExprNodeFieldEvaluator, ExprNodeGenericFuncEvaluator, ExprNodeNullEvaluator

public abstract class ExprNodeEvaluator<T extends ExprNodeDesc>
extends Object

ExprNodeEvaluator.


Field Summary
protected  T expr
           
protected  ObjectInspector outputOI
           
 
Constructor Summary
ExprNodeEvaluator(T expr)
           
 
Method Summary
protected abstract  Object _evaluate(Object row, int version)
          Evaluate value
 Object evaluate(Object row)
           
protected  Object evaluate(Object row, int version)
          Evaluate the expression given the row.
 ExprNodeEvaluator[] getChildren()
          Return child evaluators if exist
 T getExpr()
          Return child evaluators if exist
 ObjectInspector getOutputOI()
          Return initialized ObjectInspector.
abstract  ObjectInspector initialize(ObjectInspector rowInspector)
          Initialize should be called once and only once.
 boolean isDeterministic()
          Return whether this node (and all children nodes) are deterministic.
 boolean isStateful()
          Return whether this node (or any children nodes) are stateful.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expr

protected final T extends ExprNodeDesc expr

outputOI

protected ObjectInspector outputOI
Constructor Detail

ExprNodeEvaluator

public ExprNodeEvaluator(T expr)
Method Detail

getExpr

public T getExpr()
Return child evaluators if exist


initialize

public abstract ObjectInspector initialize(ObjectInspector rowInspector)
                                    throws HiveException
Initialize should be called once and only once. Return the ObjectInspector for the return value, given the rowInspector.

Throws:
HiveException

getOutputOI

public ObjectInspector getOutputOI()
Return initialized ObjectInspector. If it's not initilized, throws runtime exception


evaluate

public Object evaluate(Object row)
                throws HiveException
Throws:
HiveException

evaluate

protected Object evaluate(Object row,
                          int version)
                   throws HiveException
Evaluate the expression given the row. This method should use the rowInspector passed in from initialize to inspect the row object. The return value will be inspected by the return value of initialize. If this evaluator is referenced by others, store it for them

Throws:
HiveException

_evaluate

protected abstract Object _evaluate(Object row,
                                    int version)
                             throws HiveException
Evaluate value

Throws:
HiveException

isDeterministic

public boolean isDeterministic()
Return whether this node (and all children nodes) are deterministic.


isStateful

public boolean isStateful()
Return whether this node (or any children nodes) are stateful.


getChildren

public ExprNodeEvaluator[] getChildren()
Return child evaluators if exist



Copyright © 2012 The Apache Software Foundation