79641476

Date: 2025-05-28 03:54:37
Score: 0.5
Natty:
Report link

I have found the solution

Solution 1

# add the two line to the SparkSession.builder
.config("spark.driver.extraClassPath", "/path/to/postgresql-42.7.3.jar") \
.config("spark.executor.extraClassPath", "/path/to/postgresql-42.7.3.jar") \

Solution 2

copy your postgresql-xx.x.x.jar "postgresql-42.7.4.jar" to python site packages pyspark jars path

/usr/local/lib/python3.9/site-packages/pyspark/jars
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Ahmed Kamal ELSaman