PySpark - How to add a Jar

Card Puncher Data Processing

About

How to a jar file when executing a PySpark script.

Possibilities

Installation directory

When starting pyspark, it had this directory in the classpath. Add your Jar there.

pyspark

With the pyspark client and the –jars option

pyspark --jars file1.jar,file2.jar

configuration

Spark - Configuration

spark.jars

conf = SparkConf().set("spark.jars", "/path/to.jar")
sc = SparkContext( conf=conf)

SPARK_CLASSPATH

See Spark - Classpath (SPARK_CLASSPATH)







Share this page:
Follow us:
Task Runner