protected void setQueryType(ASTNode tree) {
    if (queryProperties.getQueryType() != null) {
      return; //already figured out
    }
    // in case of a semantic exception (e.g. a table not found or something else)
    // the root AST Node can still imply if this is a query, try to fall back to that
    // instead of ""
    QueryType queryType = QueryType.OTHER;
    if ("TOK_QUERY".equalsIgnoreCase(tree.getText())) {
      queryType = QueryType.DQL;
    }
    queryProperties.setQueryType(queryType);
  }
Handles all the magic to resolve the queryType that hasn't already been taken care of by subclasses or different
code paths in the semantic analyzers (and corresponding factories), so this method is typically called at the end
of the analysis process, where all the analysis context is present as well as the AST.
@param tree the root ASTNode of the query
ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java