This is an automated email from the ASF dual-hosted git repository.

abstractdog pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 7cd5d324101 HIVE-29170: Restrict the Query History service from being 
modified at the session level (#6051)
7cd5d324101 is described below

commit 7cd5d3241012ecd5769a8405724b781d696d8b76
Author: Bodor Laszlo <[email protected]>
AuthorDate: Thu Nov 20 11:29:34 2025 +0100

    HIVE-29170: Restrict the Query History service from being modified at the 
session level (#6051)
---
 common/src/java/org/apache/hadoop/hive/conf/HiveConf.java              | 3 ++-
 .../src/test/java/org/apache/hive/jdbc/TestRestrictedList.java         | 1 +
 .../org/apache/hadoop/hive/ql/queryhistory/QueryHistoryService.java    | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 
b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
index 72519be0cda..966a97150f5 100644
--- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
+++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
@@ -5639,7 +5639,8 @@ public static enum ConfVars {
             "hive.zookeeper.ssl.truststore.type," +
             "hive.iceberg.allow.datafiles.in.table.location.only," +
             "hive.hook.proto.base-directory," +
-            "hive.rewrite.data.policy",
+            "hive.rewrite.data.policy," +
+            "hive.query.history.enabled", // Query History service is 
initialized on HS2 startup (HIVE-29170)
         "Comma separated list of configuration options which are immutable at 
runtime"),
     HIVE_CONF_HIDDEN_LIST("hive.conf.hidden.list",
         METASTORE_PWD.varname + "," + 
HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname
diff --git 
a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestRestrictedList.java 
b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestRestrictedList.java
index 0eca3a4f3c0..ce068340395 100644
--- 
a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestRestrictedList.java
+++ 
b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestRestrictedList.java
@@ -112,6 +112,7 @@ public static void startServices() throws Exception {
     
addToExpectedRestrictedMap("hive.iceberg.allow.datafiles.in.table.location.only");
     addToExpectedRestrictedMap("hive.hook.proto.base-directory");
     addToExpectedRestrictedMap("hive.rewrite.data.policy");
+    addToExpectedRestrictedMap("hive.query.history.enabled");
 
     checkRestrictedListMatch();
   }
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/queryhistory/QueryHistoryService.java 
b/ql/src/java/org/apache/hadoop/hive/ql/queryhistory/QueryHistoryService.java
index 196664ce5a1..993fe29bedf 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/queryhistory/QueryHistoryService.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/queryhistory/QueryHistoryService.java
@@ -127,7 +127,8 @@ public void start() {
 
   public static QueryHistoryService getInstance() {
     if (instance == null) {
-      throw new RuntimeException("QueryHistoryService is not present when 
asked for the singleton instance");
+      throw new RuntimeException("QueryHistoryService is not present when 
asked for the singleton instance. " +
+              "This is not expected to happen if 'hive.query.history.enabled' 
is properly set in the HS2 config. ");
     }
     return instance;
   }

Reply via email to