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: [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]

Reply via email to