public static boolean impliesOrder(String functionName) throws SemanticException {

    FunctionInfo info = getFunctionInfo(functionName);
    if (info != null && info.isGenericUDF()) {
      UDFType type =
          AnnotationUtils.getAnnotation(info.getGenericUDF().getClass(), UDFType.class);
      if (type != null) {
        return type.impliesOrder();
      }
    }
    WindowFunctionInfo windowInfo = getWindowFunctionInfo(functionName);
    if (windowInfo != null) {
      return windowInfo.isImpliesOrder();
    }
    return false;
  }
Both UDF and UDAF functions can imply order for analytical functions

@param functionName
         name of function
@return true if a GenericUDF or GenericUDAF exists for this name and implyOrder is true, false
        otherwise.
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java