You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/08/21 12:40:57 UTC

[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3292: [KYUUBI #3064] Fix scala NPE issue when adding non-local jar URI to class loader

turboFei commented on code in PR #3292:
URL: https://github.com/apache/incubator-kyuubi/pull/3292#discussion_r950839841


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/ExecuteScala.scala:
##########
@@ -64,8 +68,19 @@ class ExecuteScala(
       if (legacyOutput.nonEmpty) {
         warn(s"Clearing legacy output from last interpreting:\n $legacyOutput")
       }
-      val jars = spark.sharedState.jarClassLoader.getURLs
-      repl.addUrlsToClassPath(jars: _*)
+      spark.sharedState.jarClassLoader.getURLs.foreach { jar =>
+        try {
+          if ("file".equals(jar.toURI.getScheme)) {
+            repl.addUrlsToClassPath(jar)
+          } else {
+            spark.sparkContext.addFile(jar.toString)

Review Comment:
   it is tricky, but I can not find another solution for this.
   
   cc @yaooqinn  @iodone @942011334



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org