diff --git data/conf/llap/tez-site.xml data/conf/llap/tez-site.xml
index 62f97c5678..a9b4f09033 100644
--- data/conf/llap/tez-site.xml
+++ data/conf/llap/tez-site.xml
@@ -20,4 +20,9 @@
20000
+
+ hive.conf.restricted.list
+ hive.query.max.length
+ Using property defined in HiveConf.ConfVars to test System property overriding
+
diff --git itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
index 034d7f89ee..8d3856b742 100644
--- itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
+++ itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
@@ -204,6 +204,9 @@ public QTestUtil(QTestArguments testArgs) throws Exception {
System.out.println("Setting hive-site: " + HiveConf.getHiveSiteLocation());
}
+ // For testing configurations set by System.setProperties
+ System.setProperty("hive.query.max.length", "100Mb");
+
conf = new HiveConf(IDriver.class);
setMetaStoreProperties();
diff --git ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
index 6c6138ef56..55bd27e006 100644
--- ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
+++ ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
@@ -416,7 +416,6 @@ public SessionState(HiveConf conf, String userName) {
resourceMaps = new ResourceMaps();
// Must be deterministic order map for consistent q-test output across Java versions
overriddenConfigurations = new LinkedHashMap();
- overriddenConfigurations.putAll(HiveConf.getConfSystemProperties());
// if there isn't already a session name, go ahead and create it.
if (StringUtils.isEmpty(conf.getVar(HiveConf.ConfVars.HIVESESSIONID))) {
conf.setVar(HiveConf.ConfVars.HIVESESSIONID, makeSessionId());
diff --git ql/src/test/queries/clientpositive/reset_conf.q ql/src/test/queries/clientpositive/reset_conf.q
index 8420d0225b..25d403c940 100644
--- ql/src/test/queries/clientpositive/reset_conf.q
+++ ql/src/test/queries/clientpositive/reset_conf.q
@@ -4,11 +4,16 @@ set hive.skewjoin.key=300000;
set hive.skewjoin.mapjoin.min.split=256000000;
set hive.skewjoin.key;
set hive.skewjoin.mapjoin.min.split;
+set hive.query.max.length;
+reset;
+-- Double reset to check if the System.property setting is not reverted
reset;
set hive.skewjoin.key;
set hive.skewjoin.mapjoin.min.split;
+-- Should not be set back to 10Mb, should keep 100Mb
+set hive.query.max.length;
set hive.skewjoin.key=300000;
set hive.skewjoin.mapjoin.min.split=256000000;
diff --git ql/src/test/results/clientpositive/llap/reset_conf.q.out ql/src/test/results/clientpositive/llap/reset_conf.q.out
index 12f2555f27..3e07a5f511 100644
--- ql/src/test/results/clientpositive/llap/reset_conf.q.out
+++ ql/src/test/results/clientpositive/llap/reset_conf.q.out
@@ -2,8 +2,10 @@ hive.skewjoin.key=100000
hive.skewjoin.mapjoin.min.split=33554432
hive.skewjoin.key=300000
hive.skewjoin.mapjoin.min.split=256000000
+hive.query.max.length=100Mb
hive.skewjoin.key=100000
hive.skewjoin.mapjoin.min.split=33554432
+hive.query.max.length=100Mb
PREHOOK: query: select 'After setting hive.skewjoin.key and hive.skewjoin.mapjoin.min.split'
PREHOOK: type: QUERY
PREHOOK: Input: _dummy_database@_dummy_table