File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
sql/hive/src/main/scala/org/apache/spark/sql/hive/client Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -292,15 +292,17 @@ private[hive] class HiveClientImpl(
292292 def withHiveState [A ](f : => A ): A = retryLocked {
293293 val original = Thread .currentThread().getContextClassLoader
294294 val originalConfLoader = state.getConf.getClassLoader
295- // The classloader in clientLoader could be changed after addJar, always use the latest
296- // classloader. We explicitly set the context class loader since "conf.setClassLoader" does
295+ // We explicitly set the context class loader since "conf.setClassLoader" does
297296 // not do that, and the Hive client libraries may need to load classes defined by the client's
298- // class loader.
297+ // class loader. See SPARK-19804 for more details.
299298 Thread .currentThread().setContextClassLoader(clientLoader.classLoader)
300299 state.getConf.setClassLoader(clientLoader.classLoader)
301300 // Set the thread local metastore client to the client associated with this HiveClientImpl.
302301 Hive .set(client)
303302 // Replace conf in the thread local Hive with current conf
303+ // with the side-effect of Hive.get(conf) to avoid using out-of-date HiveConf.
304+ // See discussion in https://github.com/apache/spark/pull/16826/files#r104606859
305+ // for more details.
304306 Hive .get(conf)
305307 // setCurrentSessionState will use the classLoader associated
306308 // with the HiveConf in `state` to override the context class loader of the current
You can’t perform that action at this time.
0 commit comments