Spark Redshift with Python
<p>I'm trying to connect Spark with amazon Redshift but i'm getting this error :</p>

<p><a href="https://i.stack.imgur.com/EV8RD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EV8RD.png" alt="enter image description here"></a></p>

<p>My code is as follow : </p>

<pre><code>from pyspark.sql import SQLContext
from pyspark import SparkContext

sc = SparkContext(appName="Connect Spark with Redshift")
sql_context = SQLContext(sc)
sc._jsc.hadoopConfiguration().set("fs.s3n.awsAccessKeyId", &lt;ACCESSID&gt;)
sc._jsc.hadoopConfiguration().set("fs.s3n.awsSecretAccessKey", &lt;ACCESSKEY&gt;)

df = sql_context.read \
    .option("url", "jdbc:redshift://example.coyf2i236wts.eu-central-    1.redshift.amazonaws.com:5439/agcdb?user=user&amp;password=pwd") \
    .option("dbtable", "table_name") \
    .option("tempdir", "bucket") \
    .load()
</code></pre>