Skip to content

Commit 77dd043

Browse files
committed
HIVE-29170: Restrict the Query History service from being modified at the session level
1 parent 1d6179d commit 77dd043

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

common/src/java/org/apache/hadoop/hive/conf/HiveConf.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5643,7 +5643,8 @@ public static enum ConfVars {
56435643
"hive.zookeeper.ssl.truststore.type," +
56445644
"hive.iceberg.allow.datafiles.in.table.location.only," +
56455645
"hive.hook.proto.base-directory," +
5646-
"hive.rewrite.data.policy",
5646+
"hive.rewrite.data.policy," +
5647+
"hive.query.history.enabled", // Query History service is initialized on HS2 startup (HIVE-29170)
56475648
"Comma separated list of configuration options which are immutable at runtime"),
56485649
HIVE_CONF_HIDDEN_LIST("hive.conf.hidden.list",
56495650
METASTORE_PWD.varname + "," + HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname

itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestRestrictedList.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public static void startServices() throws Exception {
112112
addToExpectedRestrictedMap("hive.iceberg.allow.datafiles.in.table.location.only");
113113
addToExpectedRestrictedMap("hive.hook.proto.base-directory");
114114
addToExpectedRestrictedMap("hive.rewrite.data.policy");
115+
addToExpectedRestrictedMap("hive.query.history.enabled");
115116

116117
checkRestrictedListMatch();
117118
}

ql/src/java/org/apache/hadoop/hive/ql/queryhistory/QueryHistoryService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ public void start() {
127127

128128
public static QueryHistoryService getInstance() {
129129
if (instance == null) {
130-
throw new RuntimeException("QueryHistoryService is not present when asked for the singleton instance");
130+
throw new RuntimeException("QueryHistoryService is not present when asked for the singleton instance. " +
131+
"This is not expected to happen if 'hive.query.history.enabled' is properly set in the HS2 config. ");
131132
}
132133
return instance;
133134
}

0 commit comments

Comments
 (0)