title: How to connect to Amazon Redshift or other DB's in Apache Spark?
body: <p>I'm trying to connect to Amazon Redshift via Spark, so I can join data we have on S3 with data on our RS cluster. I found some very spartan documentation here for the capability of connecting to JDBC:</p>
  
  <p><a href="https://spark.apache.org/docs/1.3.1/sql-programming-guide.html#jdbc-to-other-databases" rel="noreferrer">https://spark.apache.org/docs/1.3.1/sql-programming-guide.html#jdbc-to-other-databases</a></p>
  
  <p>The load command seems fairly straightforward (although I don't know how I would enter AWS credentials here, maybe in the options?).</p>
  
  <pre><code>df = sqlContext.load(source="jdbc", url="jdbc:postgresql:dbserver", dbtable="schema.tablename")
  </code></pre>
  
  <p>And I'm not entirely sure how to deal with the SPARK_CLASSPATH variable. I'm running Spark locally for now through an iPython notebook (as part of the Spark distribution). Where do I define that so that Spark loads it? </p>
  
  <p>Anyway, for now, when I try running these commands, I get a bunch of undecipherable errors, so I'm kind of stuck for now. Any help or pointers to detailed tutorials are appreciated.</p>