private static boolean isCustomUDF(String udfName) {
    if (udfName == null) {
      return false;
    }
    FunctionInfo funcInfo;
    try {
      funcInfo = FunctionRegistry.getFunctionInfo(udfName);
    } catch (SemanticException e) {
      LOG.warn("Failed to load " + udfName, e);
      funcInfo = null;
    }
    if (funcInfo == null) {
      return false;
    }
    boolean isNativeFunc = funcInfo.isNative();
    return !isNativeFunc;
  }
The GenericUDFs might need their children output to be cast to the given castType.
This method returns a cast expression that would achieve the required casting.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java