if (varname.startsWith(SetProcessor.ENV_PREFIX)){
ss.err.println("env:* variables can not be set.");
return new CommandProcessorResponse(1);
} else if (varname.startsWith(SetProcessor.SYSTEM_PREFIX)){
String propName = varname.substring(SetProcessor.SYSTEM_PREFIX.length());
System.getProperties().setProperty(propName, new VariableSubstitution().substitute(ss.getConf(),varvalue));
return new CommandProcessorResponse(0);
} else if (varname.startsWith(SetProcessor.HIVECONF_PREFIX)){
String propName = varname.substring(SetProcessor.HIVECONF_PREFIX.length());
try {
setConf(varname, propName, varvalue, false);
return new CommandProcessorResponse(0);
} catch (IllegalArgumentException e) {
return new CommandProcessorResponse(1, e.getMessage(), "42000");
}
} else if (varname.startsWith(SetProcessor.HIVEVAR_PREFIX)) {
String propName = varname.substring(SetProcessor.HIVEVAR_PREFIX.length());
ss.getHiveVariables().put(propName, new VariableSubstitution().substitute(ss.getConf(),varvalue));
return new CommandProcessorResponse(0);
} else {
try {
setConf(varname, varname, varvalue, true);
return new CommandProcessorResponse(0);