private Configuration getBestAvailableConf() {
    // First attempt to get the configuration if any that ExprNodeGenericFuncEvaluator
    // was initialized with
    if (getConf() != null) {
      return getConf();
    }

    // Second attempt, try to get the sesssion's configuration
    SessionState ss = SessionState.get();
    if (ss != null && ss.getConf() != null) {
      return ss.getConf();
    }

    // Last resort is to create a new HiveConf object. It does not have any "runtime"
    // changes to the configuration but that is the best we can do if we get this far.
    return new HiveConf();
  }
Class to allow deferred evaluation for GenericUDF.
ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeGenericFuncEvaluator.java