public static String ensureClassExists(String className)
      throws SemanticException {
    if (className == null) {
      return null;
    }
    try {
      Class.forName(className, true, Utilities.getSessionSpecifiedClassLoader());
    } catch (ClassNotFoundException e) {
      throw new SemanticException("Cannot find class '" + className + "'", e);
    }
    return className;
  }
Performs a descent of the leftmost branch of a tree, stopping when either a
node with a non-null token is found or the leaf level is encountered.

@param tree
         candidate node from which to start searching

@return node at which descent stopped
ql/src/java/org/apache/hadoop/hive/ql/parse/ParseUtils.java