public static void stripConfigurations(Configuration conf, Set<String> hiddenSet) {

    // Find all configurations where the key contains any string from hiddenSet
    Iterable<Map.Entry<String, String>> matching =
        Iterables.filter(conf, confEntry -> {
          for (String name : hiddenSet) {
            if (confEntry.getKey().startsWith(name)) {
              return true;
            }
          }
          return false;
        });

    // Remove the value of every key found matching
    matching.forEach(entry -> conf.set(entry.getKey(), StringUtils.EMPTY));
  }
Strips hidden config entries from configuration
@param conf The configuration to strip from
@param hiddenSet The values to strip
common/src/java/org/apache/hadoop/hive/conf/HiveConfUtil.java