@Override
  protected Object _evaluate(Object row, int version) throws HiveException {
    if (isConstant) {
      // The output of this UDF is constant, so don't even bother evaluating.
      return ((ConstantObjectInspector) outputOI).getWritableConstantValue();
    }
    rowObject = row;
    for (GenericUDF.DeferredObject deferredObject : childrenNeedingPrepare) {
      deferredObject.prepare(version);
    }
    return genericUDF.evaluate(deferredChildren);
  }
Class to allow deferred evaluation for GenericUDF.
ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeGenericFuncEvaluator.java