Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all additional jars loaded in pyspark

I want to see the jars my spark context is using. I found the code in Scala:

$ spark-shell --jars --master=spark://datasci:7077 --jars /opt/jars/xgboost4j-spark-0.7-jar-with-dependencies.jar --packages elsevierlabs-os:spark-xml-utils:1.6.0

scala> spark.sparkContext.listJars.foreach(println)
spark://datasci:42661/jars/net.sf.saxon_Saxon-HE-9.6.0-7.jar
spark://datasci:42661/jars/elsevierlabs-os_spark-xml-utils-1.6.0.jar
spark://datasci:42661/jars/org.apache.commons_commons-lang3-3.4.jar
spark://datasci:42661/jars/commons-logging_commons-logging-1.2.jar
spark://datasci:42661/jars/xgboost4j-spark-0.7-jar-with-dependencies.jar
spark://datasci:42661/jars/commons-io_commons-io-2.4.jar

Source: List All Additional Jars Loaded in Spark

But I could not find how to do it in PySpark. Any suggestions?

Thanks

like image 328
Eli Simhayev Avatar asked Jul 16 '19 12:07

Eli Simhayev


1 Answers

sparkContext._jsc.sc().listJars()

_jsc is the java spark context

like image 67
jobevers Avatar answered Oct 29 '22 15:10

jobevers