How to add third party java jars for use in pyspark

前端 未结 9 1842
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 03:08

I have some third party Database client libraries in Java. I want to access them through

java_gateway.py

E.g: to make the client class (not

9条回答
  •  情歌与酒
    2020-11-29 03:21

    You could add --jars xxx.jar when using spark-submit

    ./bin/spark-submit --jars xxx.jar your_spark_script.py
    

    or set the enviroment variable SPARK_CLASSPATH

    SPARK_CLASSPATH='/path/xxx.jar:/path/xx2.jar' your_spark_script.py
    

    your_spark_script.py was written by pyspark API

提交回复
热议问题