static String setConf(SessionState ss, String varName, String key, String varValue, boolean register)
        throws IllegalArgumentException {
    String result = null;
    HiveConf conf = ss.getConf();
    String value = new VariableSubstitution(new HiveVariableSource() {
      @Override
      public Map<String, String> getHiveVariable() {
        return ss.getHiveVariables();
      }
    }).substitute(conf, varValue);
    if (conf.getBoolVar(HiveConf.ConfVars.HIVE_CONF_VALIDATION)) {
      HiveConf.ConfVars confVars = HiveConf.getConfVars(key);
      if (confVars != null) {
        if (!confVars.isType(value)) {
          StringBuilder message = new StringBuilder();
          message.append("'SET ").append(varName).append('=').append(varValue);
          message.append("' FAILED because ").append(key).append(" expects ");
          message.append(confVars.typeString()).append(" type value.");
          throw new IllegalArgumentException(message.toString());
        }
        String fail = confVars.validate(value);
        if (fail != null) {
          StringBuilder message = new StringBuilder();
          message.append("'SET ").append(varName).append('=').append(varValue);
          message.append("' FAILED in validation : ").append(fail).append('.');
          throw new IllegalArgumentException(message.toString());
        }
      } else if (!removedConfigs.contains(key) && key.startsWith("hive.")) {
        throw new IllegalArgumentException("hive configuration " + key + " does not exists.");
      }
    }
    conf.verifyAndSet(key, value);
    if (conf.isLockedConfig(key)) {
      console.printWarn("Cannot modify " + key + " at runtime. "
              + "It is in the list of locked configurations that can't be modified at runtime");
    }
    if (HiveConf.ConfVars.HIVE_EXECUTION_ENGINE.varname.equals(key)) {
      if ("mr".equals(value)) {
        result = HiveConf.generateMrDeprecationWarning();
        LOG.warn(result);
      }
    }
    if (HiveConf.ConfVars.CREATE_TABLE_AS_EXTERNAL.varname.equals(key)) {
      result = HiveConf.generateDeprecationWarning();
      LOG.warn(result);
    }
    if (register) {
      ss.getOverriddenConfigurations().put(key, value);
    }
    return result;
  }
@return A console message that is not strong enough to fail the command (e.g. deprecation).
ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java