This is an automated email from the ASF dual-hosted git repository.

dongjoon-hyun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 08914ddcf23e [SPARK-60975][SQL] Remove unused 
`PythonSQLUtils.addJarToCurrentClassLoader`
08914ddcf23e is described below

commit 08914ddcf23e6aa2b233ea263c31842b3206a527
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Thu Nov 5 20:00:47 2026 -0800

    [SPARK-60975][SQL] Remove unused `PythonSQLUtils.addJarToCurrentClassLoader`
    
    ### What changes were proposed in this pull request?
    
    This PR removes the unused `PythonSQLUtils.addJarToCurrentClassLoader` 
method and the imports and `Logging` mixin that become unused with it 
(`LogKeys.CLASS_LOADER`, `MutableURLClassLoader`, `Utils`).
    
    ### Why are the changes needed?
    
    `addJarToCurrentClassLoader` was added by SPARK-41933 (2023-01-08) as an 
internal helper so that `pyspark.sql.connect.session` could add the Spark 
Connect jar to the JVM class loader in local mode. Its only caller was removed 
by SPARK-42197 (2023-01-26), which switched local mode to configuration-based 
setup (`spark.plugins` and `spark.sql.artifact.isolation.*`). No caller exists 
in Python, Connect, or any other module, so the method is dead code.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No. The method is internal (`private[sql] object PythonSQLUtils`), 
documented as for local development only, and has no callers.
    
    ### How was this patch tested?
    
    Pass the CIs. Also verified locally with `build/sbt sql/Test/compile`.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Sonnet 5.5
    
    Closes #60154 from dongjoon-hyun/SPARK-60975.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 .../apache/spark/sql/api/python/PythonSQLUtils.scala   | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git 
a/sql/core/src/main/scala/org/apache/spark/sql/api/python/PythonSQLUtils.scala 
b/sql/core/src/main/scala/org/apache/spark/sql/api/python/PythonSQLUtils.scala
index a2aef54f1cd7..e267924cc5f7 100644
--- 
a/sql/core/src/main/scala/org/apache/spark/sql/api/python/PythonSQLUtils.scala
+++ 
b/sql/core/src/main/scala/org/apache/spark/sql/api/python/PythonSQLUtils.scala
@@ -24,8 +24,6 @@ import net.razorvine.pickle.{Pickler, Unpickler}
 
 import org.apache.spark.SparkContext
 import org.apache.spark.api.python.DechunkedInputStream
-import org.apache.spark.internal.Logging
-import org.apache.spark.internal.LogKeys.CLASS_LOADER
 import org.apache.spark.security.SocketAuthServer
 import org.apache.spark.sql.{internal, Column, DataFrame, DataFrameReader, 
Dataset, Encoders, Row, SparkSession, TableArg}
 import org.apache.spark.sql.catalyst.{CatalystTypeConverters, InternalRow}
@@ -43,9 +41,8 @@ import org.apache.spark.sql.execution.python.EvaluatePython
 import org.apache.spark.sql.internal.SQLConf
 import org.apache.spark.sql.types.{DataType, StructType}
 import org.apache.spark.storage.PythonWorkerLogBlockId
-import org.apache.spark.util.{MutableURLClassLoader, Utils}
 
-private[sql] object PythonSQLUtils extends Logging {
+private[sql] object PythonSQLUtils {
   private def withInternalRowPickler(f: Pickler => Array[Byte]): Array[Byte] = 
{
     EvaluatePython.registerPicklers()
     val pickler = new Pickler(true, false)
@@ -134,19 +131,6 @@ private[sql] object PythonSQLUtils extends Logging {
     deserializer(internalRow)
   }
 
-  /**
-   * Internal-only helper for Spark Connect's local mode. This is only used for
-   * local development, not for production. This method should not be used in
-   * production code path.
-   */
-  def addJarToCurrentClassLoader(path: String): Unit = {
-    Utils.getContextOrSparkClassLoader match {
-      case cl: MutableURLClassLoader => cl.addURL(Utils.resolveURI(path).toURL)
-      case cl => logWarning(log"Unsupported class loader ${MDC(CLASS_LOADER, 
cl)} will not " +
-        log"update jars in the thread class loader.")
-    }
-  }
-
   def jsonToDDL(json: String): String = {
     DataType.fromJson(json).asInstanceOf[StructType].toDDL
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to