You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/03/13 16:20:28 UTC

[GitHub] [spark] squito commented on a change in pull request #24057: [SPARK-26839][SQL] Work around classloader changes in Java 9 for Hive isolation

squito commented on a change in pull request #24057: [SPARK-26839][SQL] Work around classloader changes in Java 9 for Hive isolation
URL: https://github.com/apache/spark/pull/24057#discussion_r265213623
 
 

 ##########
 File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala
 ##########
 @@ -329,10 +326,17 @@ private[spark] object HiveUtils extends Logging {
 
       val classLoader = Utils.getContextOrSparkClassLoader
       val jars = allJars(classLoader)
-      if (jars.length == 0) {
-        throw new IllegalArgumentException(
-          "Unable to locate hive jars to connect to metastore. " +
-            s"Please set ${HIVE_METASTORE_JARS.key}.")
+      if (SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)) {
+        // Do nothing. The system classloader is no longer a URLClassLoader in Java 9,
 
 Review comment:
   I think your approach makes more sense.  I was a little worried that someone would add a jar directly to classloader, from java code, which wouldn't show up on java.class.path.  probably an unsupported gray area anyway, but this might make it work in a few more cases

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org