diff --git build.properties build.properties index b0df291..d25b63f 100644 --- build.properties +++ build.properties @@ -72,8 +72,8 @@ jsp.test.jar=${hadoop.root}/lib/jetty-ext/jsp-api.jar common.jar=${hadoop.root}/lib/commons-httpclient-3.0.1.jar # module names needed for build process -iterate.hive.all=ant,shims,common,serde,metastore,ql,contrib,service,cli,jdbc,beeline,hwi,hbase-handler,pdk,builtins -iterate.hive.modules=shims,common,serde,metastore,ql,contrib,service,cli,jdbc,beeline,hwi,hbase-handler,pdk,builtins +iterate.hive.all=ant,shims,common,serde,metastore,ql,contrib,service,cli,jdbc,beeline,hwi,hbase-handler,pdk,builtins,testutils +iterate.hive.modules=shims,common,serde,metastore,ql,contrib,service,cli,jdbc,beeline,hwi,hbase-handler,pdk,builtins,testutils iterate.hive.tests=ql,contrib,hbase-handler,hwi,jdbc,metastore,odbc,serde,service iterate.hive.thrift=ql,service,metastore,serde iterate.hive.protobuf=ql diff --git ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java index 912c4ad..1075eb2 100644 --- ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java +++ ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java @@ -28,8 +28,8 @@ import java.util.TreeMap; import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.api.Schema; import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.metastore.api.Schema; import org.apache.hadoop.hive.ql.parse.VariableSubstitution; import org.apache.hadoop.hive.ql.session.SessionState; @@ -117,31 +117,28 @@ private CommandProcessorResponse setVariable(String varname, String varvalue){ } else if (varname.startsWith(SetProcessor.HIVECONF_PREFIX)){ String propName = varname.substring(SetProcessor.HIVECONF_PREFIX.length()); try { - ss.getConf().verifyAndSet(propName, new VariableSubstitution().substitute(ss.getConf(),varvalue)); + setConf(varname, propName, varvalue, false); return new CommandProcessorResponse(0); } catch (IllegalArgumentException e) { - ss.out.println(e.getMessage()); - return new CommandProcessorResponse(-1, e.getMessage(), "42000"); + 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 { - String substitutedValue = new VariableSubstitution().substitute(ss.getConf(),varvalue); try { - ss.getConf().verifyAndSet(varname, substitutedValue ); - ss.getOverriddenConfigurations().put(varname, substitutedValue); + setConf(varname, varname, varvalue, true); return new CommandProcessorResponse(0); } catch (IllegalArgumentException e) { - ss.out.println(e.getMessage()); - return new CommandProcessorResponse(-1, e.getMessage(), "42000"); + return new CommandProcessorResponse(1, e.getMessage(), "42000"); } } } // returns non-null string for validation fail - private String setConf(String varname, String key, String varvalue, boolean register) { + private void setConf(String varname, String key, String varvalue, boolean register) + throws IllegalArgumentException { HiveConf conf = SessionState.get().getConf(); String value = new VariableSubstitution().substitute(conf, varvalue); if (conf.getBoolVar(HiveConf.ConfVars.HIVECONFVALIDATION)) { @@ -151,14 +148,13 @@ private String setConf(String varname, String key, String varvalue, boolean regi message.append("'SET ").append(varname).append('=').append(varvalue); message.append("' FAILED because "); message.append(key).append(" expects an "); message.append(confVars.typeString()).append(" value."); - return message.toString(); + throw new IllegalArgumentException(message.toString()); } } - conf.set(key, value); + conf.verifyAndSet(key, value); if (register) { SessionState.get().getOverriddenConfigurations().put(key, value); } - return null; } private SortedMap propertiesToSortedMap(Properties p){