You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "abstractdog (via GitHub)" <gi...@apache.org> on 2026/03/03 09:24:29 UTC

Re: [PR] HIVE-29470: Add unit test to verify commonLocalResources after openin… [hive]

abstractdog commented on code in PR #6338:
URL: https://github.com/apache/hive/pull/6338#discussion_r2877093401


##########
ql/src/test/org/apache/hadoop/hive/ql/exec/tez/TestTezSessionState.java:
##########
@@ -90,4 +91,42 @@ void openInternalUnsafe(boolean isAsync, SessionState.LogHelper console) throws
     Assert.assertFalse("Scratch dir is not supposed to exist after cleanup: " + scratchDirPath.get(),
         Files.exists(Paths.get(scratchDirPath.get())));
   }
+
+  /**
+   * Tests whether commonLocalResources is populated with app jar and localized resources when opening
+   * a Tez session.
+   */
+  @Test
+  public void testCommonLocalResourcesPopulatedOnSessionOpen() throws Exception {
+    Path jarPath = Files.createTempFile("test-jar", ".jar");
+    Files.write(jarPath, "testCommonLocalResourcesPopulated".getBytes(), StandardOpenOption.APPEND);
+
+    HiveConf hiveConf = new HiveConfForTest(getClass());
+    hiveConf.set("hive.security.authorization.manager",
+        "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdConfOnlyAuthorizerFactory");
+    SessionState.start(hiveConf);

Review Comment:
   start method returns the SessionState object with can be used later instead of `SessionState.get()`: while this also work, the object is better to be seen clearly here, instead of relying on the whole ThreadLocal magic of the SessionState universe



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org