Index: ql/src/test/results/clientpositive/reset_conf.q.out =================================================================== --- ql/src/test/results/clientpositive/reset_conf.q.out (revision 0) +++ ql/src/test/results/clientpositive/reset_conf.q.out (revision 0) @@ -0,0 +1,6 @@ +hive.skewjoin.key=100000 +hive.skewjoin.mapjoin.min.split=33554432 +hive.skewjoin.key=300000 +hive.skewjoin.mapjoin.min.split=256000000 +hive.skewjoin.key=100000 +hive.skewjoin.mapjoin.min.split=33554432 Index: ql/src/test/queries/clientpositive/reset_conf.q =================================================================== --- ql/src/test/queries/clientpositive/reset_conf.q (revision 0) +++ ql/src/test/queries/clientpositive/reset_conf.q (revision 0) @@ -0,0 +1,11 @@ +set hive.skewjoin.key; +set hive.skewjoin.mapjoin.min.split; +set hive.skewjoin.key=300000; +set hive.skewjoin.mapjoin.min.split=256000000; +set hive.skewjoin.key; +set hive.skewjoin.mapjoin.min.split; + +reset; + +set hive.skewjoin.key; +set hive.skewjoin.mapjoin.min.split; Index: ql/src/java/org/apache/hadoop/hive/ql/processors/ResetProcessor.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/processors/ResetProcessor.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/processors/ResetProcessor.java (revision 0) @@ -0,0 +1,45 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.processors; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.ql.CommandNeedRetryException; +import org.apache.hadoop.hive.ql.session.SessionState; + +public class ResetProcessor implements CommandProcessor { + + public void init() { + } + + public CommandProcessorResponse run(String command) throws CommandNeedRetryException { + SessionState ss = SessionState.get(); + if (ss.getOverriddenConfigurations().isEmpty()) { + return new CommandProcessorResponse(0); + } + HiveConf conf = new HiveConf(); + for (String key : ss.getOverriddenConfigurations().keySet()) { + String value = conf.get(key); + if (value != null) { + ss.getConf().set(key, value); + } + } + ss.getOverriddenConfigurations().clear(); + return new CommandProcessorResponse(0); + } +} Index: ql/src/java/org/apache/hadoop/hive/ql/processors/CommandProcessorFactory.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/processors/CommandProcessorFactory.java (revision 1362327) +++ ql/src/java/org/apache/hadoop/hive/ql/processors/CommandProcessorFactory.java (working copy) @@ -46,6 +46,8 @@ if ("set".equals(cmdl)) { return new SetProcessor(); + } else if ("reset".equals(cmdl)) { + return new ResetProcessor(); } else if ("dfs".equals(cmdl)) { SessionState ss = SessionState.get(); return new DfsProcessor(ss.getConf());