private CommandProcessorResponse getVariable(String varName) throws Exception {
    SessionState ss = SessionState.get();
    if (varName.equals("silent")){
      ss.out.println("silent" + "=" + ss.getIsSilent());
      return new CommandProcessorResponse(getSchema(), null);
    }
    if (varName.startsWith(SYSTEM_PREFIX)) {
      String propName = varName.substring(SYSTEM_PREFIX.length());
      String result = System.getProperty(propName);
      if (result != null) {
        if(isHidden(propName)) {
          ss.out.println(SYSTEM_PREFIX + propName + " is a hidden config");
        } else {
          ss.out.println(SYSTEM_PREFIX + propName + "=" + result);
        }
        return new CommandProcessorResponse(getSchema(), null);
      } else {
        ss.out.println(propName + " is undefined as a system property");
        throw new CommandProcessorException(1);
      }
    } else if (varName.indexOf(ENV_PREFIX) == 0) {
      String var = varName.substring(ENV_PREFIX.length());
      if (System.getenv(var) != null) {
        if(isHidden(var)) {
          ss.out.println(ENV_PREFIX + var + " is a hidden config");
        } else {
          ss.out.println(ENV_PREFIX + var + "=" + System.getenv(var));
        }
        return new CommandProcessorResponse(getSchema(), null);
      } else {
        ss.out.println(varName + " is undefined as an environmental variable");
        throw new CommandProcessorException(1);
      }
    } else if (varName.indexOf(HIVECONF_PREFIX) == 0) {
      String var = varName.substring(HIVECONF_PREFIX.length());
      if (ss.getConf().isHiddenConfig(var)) {
        ss.out.println(HIVECONF_PREFIX + var + " is a hidden config");
        return new CommandProcessorResponse(getSchema(), null);
      } if (ss.getConf().get(var) != null) {
        ss.out.println(HIVECONF_PREFIX + var + "=" + ss.getConf().get(var));
        return new CommandProcessorResponse(getSchema(), null);
      } else {
        ss.out.println(varName + " is undefined as a hive configuration variable");
        throw new CommandProcessorException(1);
      }
    } else if (varName.indexOf(HIVEVAR_PREFIX) == 0) {
      String var = varName.substring(HIVEVAR_PREFIX.length());
      if (ss.getHiveVariables().get(var) != null) {
        ss.out.println(HIVEVAR_PREFIX + var + "=" + ss.getHiveVariables().get(var));
        return new CommandProcessorResponse(getSchema(), null);
      } else {
        ss.out.println(varName + " is undefined as a hive variable");
        throw new CommandProcessorException(1);
      }
    } else if (varName.indexOf(METACONF_PREFIX) == 0) {
      String var = varName.substring(METACONF_PREFIX.length());
      Hive hive = Hive.get(ss.getConf());
      String value = hive.getMetaConf(var);
      if (value != null) {
        ss.out.println(METACONF_PREFIX + var + "=" + value);
        return new CommandProcessorResponse(getSchema(), null);
      } else {
        ss.out.println(varName + " is undefined as a hive meta variable");
        throw new CommandProcessorException(1);
      }
    } else {
      dumpOption(varName);
      return new CommandProcessorResponse(getSchema(), null);
    }
  }
@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