private boolean isResultsCacheEnabled() {
    return conf.getBoolVar(HiveConf.ConfVars.HIVE_QUERY_RESULTS_CACHE_ENABLED) &&
        !(SessionState.get().isHiveServerQuery() && conf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS));
  }
Generate the query string for this query (with fully resolved table references).
@return The query string with resolved references. NULL if an error occurred.
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java