public static boolean isDeterministic(ExprNodeGenericFuncDesc funcDesc) {
    if (FunctionRegistry.isConsistentWithinQuery(funcDesc.getGenericUDF())) {
      // check whether the children or deterministic
      for (ExprNodeDesc exprNodeDesc : funcDesc.getChildren()) {
        if (exprNodeDesc instanceof ExprNodeGenericFuncDesc) {
          if (!isDeterministic((ExprNodeGenericFuncDesc) exprNodeDesc)) {
            // some child is not deterministic - return false
            return false;
          }
        }
      }
      // all children are deterministic - return true
      return true;
    }

    // function is not deterministic - return false
    return false;
  }
@param funcDesc function descriptor
@return true if the function is deterministic false otherwise
ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java