public static ClassLoader getSessionSpecifiedClassLoader() {
    SessionState state = SessionState.get();
    if (state == null || state.getConf() == null) {
      LOG.debug("Hive Conf not found or Session not initiated, use thread based class loader instead");
      return JavaUtils.getClassLoader();
    }
    ClassLoader sessionCL = state.getConf().getClassLoader();
    if (sessionCL != null) {
      LOG.trace("Use session specified class loader");  //it's normal case
      return sessionCL;
    }
    LOG.debug("Session specified class loader not found, use thread based class loader");
    return JavaUtils.getClassLoader();
  }
get session specified class loader and get current class loader if fall

@return
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java