I want to debug Spark code in PyCharm because it is easier to debug. But I need to add a spark-redis.jar
otherwise Failed to find data source: redis
The code to connect to redis is
spark = SparkSession \
.builder \
.appName("Streaming Image Consumer") \
.config("spark.redis.host", self.redis_host) \
.config("spark.redis.port", self.redis_port) \
.getOrCreate()
How to do fix it if using PyCharm?
I have tried adding spark.driver.extraClassPath
in $SPARK_HOME/conf/spark-defaults.conf
but it does not work.
I also tried adding environment variable PYSPARK_SUBMIT_ARGS --jars ...
in run configuration but it raise other error