public static Class loadClass(String className, boolean init) throws ClassNotFoundException {
    return Class.forName(className, init, getClassLoader());
  }
Standard way of getting classloader in Hive code (outside of Hadoop).

Uses the context loader to get access to classpaths to auxiliary and jars
added with 'add jar' command. Falls back to current classloader.

In Hadoop-related code, we use Configuration.getClassLoader().
common/src/java/org/apache/hadoop/hive/common/JavaUtils.java