turboFei commented on code in PR #6235:
URL: https://github.com/apache/kyuubi/pull/6235#discussion_r1547086469
##########
externals/kyuubi-spark-sql-engine/src/main/scala-2.12/org/apache/kyuubi/engine/spark/repl/KyuubiSparkILoop.scala:
##########
@@ -28,47 +29,35 @@ import org.apache.spark.repl.SparkILoop
import org.apache.spark.sql.{DataFrame, SparkSession}
import org.apache.spark.util.MutableURLClassLoader
-import org.apache.kyuubi.Utils
+import org.apache.kyuubi.{Logging, Utils}
private[spark] case class KyuubiSparkILoop private (
spark: SparkSession,
output: ByteArrayOutputStream)
- extends SparkILoop(None, new PrintWriter(output)) {
+ extends SparkILoop(None, new PrintWriter(output)) with Logging {
import KyuubiSparkILoop._
val result = new DataFrameHolder(spark)
private def initialize(): Unit = withLockRequired {
+ val currentClassLoader = Thread.currentThread().getContextClassLoader
+ val allJars = getAllJars(currentClassLoader)
+ info(s"Adding jars to Scala interpreter's class path:
${allJars.mkString(File.pathSeparator)}")
settings = new Settings
val interpArguments = List(
"-Yrepl-class-based",
"-Yrepl-outdir",
- s"${spark.sparkContext.getConf.get("spark.repl.class.outputDir")}")
+ s"${spark.sparkContext.getConf.get("spark.repl.class.outputDir")}",
+ "-classpath",
+ allJars.mkString(File.pathSeparator))
Review Comment:
I tried `this.addUrlsToClassPath(allJars: _*)`, it does not work for my use
case - yarn-cluster mode.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]