public static BaseSemanticAnalyzer getAnalyzer(ASTNode root, QueryState queryState) {
    Class<? extends BaseSemanticAnalyzer> analyzerClass = getAnalyzerClass(root, queryState);
    try {
      BaseSemanticAnalyzer analyzer = analyzerClass.getConstructor(QueryState.class).newInstance(queryState);
      return analyzer;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
Reveals the actual type of an ASTTree that has a category as main element.
ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLSemanticAnalyzerFactory.java