diff --git common/src/java/org/apache/hadoop/hive/conf/HiveConf.java common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 2e2bf5a..60d64c6 100644 --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -2179,6 +2179,16 @@ private static synchronized InputStream getConfVarInputStream() { return new LoopingByteArrayInputStream(confVarByteArray); } + public boolean isRestricted(String name) throws IllegalArgumentException { + if (modWhiteListPattern != null) { + Matcher wlMatcher = modWhiteListPattern.matcher(name); + if (wlMatcher.matches()) { + return false; + } + } + return restrictList.contains(name); + } + public void verifyAndSet(String name, String value) throws IllegalArgumentException { if (modWhiteListPattern != null) { Matcher wlMatcher = modWhiteListPattern.matcher(name); 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 bc9254c..021f375 100644 --- ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java +++ ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java @@ -55,12 +55,15 @@ public static boolean getBoolean(String value) { + "' is not a boolean"); } - private void dumpOptions(Properties p) { + private void dumpOptions(Properties p, HiveConf conf) { SessionState ss = SessionState.get(); SortedMap sortedMap = new TreeMap(); sortedMap.put("silent", (ss.getIsSilent() ? "on" : "off")); for (Object one : p.keySet()) { String oneProp = (String) one; + if (conf.isRestricted(oneProp)) { + continue; + } String oneValue = p.getProperty(oneProp); sortedMap.put(oneProp, oneValue); } @@ -254,12 +257,12 @@ public CommandProcessorResponse run(String command) { String nwcmd = command.trim(); if (nwcmd.equals("")) { - dumpOptions(ss.getConf().getChangedProperties()); + dumpOptions(ss.getConf().getChangedProperties(), ss.getConf()); return createProcessorSuccessResponse(); } if (nwcmd.equals("-v")) { - dumpOptions(ss.getConf().getAllProperties()); + dumpOptions(ss.getConf().getAllProperties(), ss.getConf()); return createProcessorSuccessResponse(); }