private void savePlan(String queryName) throws SemanticException{
    SessionState ss = SessionState.get();
    assert(ss != null);

    if (ss.getPreparePlans().containsKey(queryName)) {
      throw new SemanticException("Prepare query: " + queryName + " already exists.");
    }
    ss.getPreparePlans().put(queryName, this);
  }
This method saves the current {@link PrepareStatementAnalyzer} object as well as
the config used to compile the plan.
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/parse/PrepareStatementAnalyzer.java