kuczoram commented on code in PR #6928:
URL: https://github.com/apache/hive/pull/6928#discussion_r4460974794
##########
common/src/java/org/apache/hadoop/hive/conf/HiveConfUtil.java:
##########
@@ -97,6 +97,40 @@ public static Set<String> getHiddenSet(Configuration
configuration) {
return hiddenSet;
}
+ /**
+ * Getting the set of the configurations which are immutable at runtime.
Unlike
+ * {@link HiveConf#verifyAndSet(String, String)}, this works on any {@link
Configuration} and not
+ * only on a {@link HiveConf}, which makes it usable on a JobConf.
+ * @param configuration The original configuration
+ * @return The list of the configuration prefixes which must not be modified
at runtime
+ */
+ public static Set<String> getRestrictedSet(Configuration configuration) {
+ Set<String> restrictedSet = new HashSet<String>();
+ String restrictedListStr = HiveConf.getVar(configuration,
HiveConf.ConfVars.HIVE_CONF_RESTRICTED_LIST);
+ if (restrictedListStr != null) {
+ for (String entry : restrictedListStr.split(",")) {
+ restrictedSet.add(entry.trim());
+ }
+ }
+
+ String internalVariableListStr = HiveConf.getVar(configuration,
ConfVars.HIVE_CONF_INTERNAL_VARIABLE_LIST);
+ if (internalVariableListStr != null) {
+ for (String entry : internalVariableListStr.split(",")) {
+ restrictedSet.add(entry.trim());
+ }
+ }
+
+ restrictedSet.add(ConfVars.HIVE_IN_TEST.varname);
+ restrictedSet.add(ConfVars.HIVE_CONF_RESTRICTED_LIST.varname);
+ restrictedSet.add(ConfVars.HIVE_CONF_HIDDEN_LIST.varname);
+ restrictedSet.add(ConfVars.HIVE_CONF_INTERNAL_VARIABLE_LIST.varname);
+ restrictedSet.add(ConfVars.HIVE_CONF_LOCKED_LIST.varname);
+ restrictedSet.add(ConfVars.HIVE_COMPACTOR_CONF_ALLOWLIST.varname);
+ restrictedSet.add(ConfVars.HIVE_COMPACTOR_CONF_ALLOWLIST_APPEND.varname);
+ restrictedSet.add(ConfVars.HIVE_COMPACTOR_CONF_DENYLIST.varname);
+ return restrictedSet;
+ }
Review Comment:
Yes, I think we can do that. I changed it and also added one more test case
to test if a parameter is validated against the restricted, hidden and locked
lists even if it passed the allow and deny list.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]