Yang Jie created SPARK-45874:
--------------------------------

             Summary: Remove Java version check from `IsolatedClientLoader`
                 Key: SPARK-45874
                 URL: https://issues.apache.org/jira/browse/SPARK-45874
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 4.0.0
            Reporter: Yang Jie


{code:java}
val rootClassLoader: ClassLoader =
  if (SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)) {
    // In Java 9, the boot classloader can see few JDK classes. The intended 
parent
    // classloader for delegation is now the platform classloader.
    // See http://java9.wtf/class-loading/
    val platformCL =
    classOf[ClassLoader].getMethod("getPlatformClassLoader").
      invoke(null).asInstanceOf[ClassLoader]
    // Check to make sure that the root classloader does not know about Hive.
    
assert(Try(platformCL.loadClass("org.apache.hadoop.hive.conf.HiveConf")).isFailure)
    platformCL
  } else {
    // The boot classloader is represented by null (the instance itself isn't 
accessible)
    // and before Java 9 can see all JDK classes
    null
  } {code}
Spark 4.0.0 has a minimum requirement of Java 17, so the version check for Java 
9 is not necessary.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to