private static Class<? extends BaseSemanticAnalyzer> getAnalyzerClass(ASTNode root, QueryState queryState) {
    if (TYPE_TO_ANALYZER.containsKey(root.getType())) {
      return TYPE_TO_ANALYZER.get(root.getType());
    }

    if (TYPE_TO_ANALYZERCATEGORY.containsKey(root.getType())) {
      Class<? extends DDLSemanticAnalyzerCategory> analyzerCategoryClass = TYPE_TO_ANALYZERCATEGORY.get(root.getType());
      try {
        DDLSemanticAnalyzerCategory analyzerCategory = analyzerCategoryClass.newInstance();
        int actualType = analyzerCategory.getType(root);
        if (TYPE_TO_ANALYZER.containsKey(actualType)) {
          if (queryState != null) {
            queryState.setCommandType(HiveOperation.operationForToken(actualType));
          }
          return TYPE_TO_ANALYZER.get(actualType);
        }
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }

    return null;
  }
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