Advertisement
Guest User

Untitled

a guest
Jul 12th, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. sc._jsc.hadoopConfiguration().set("fs.s3n.awsAccessKeyId", "")
  2. sc._jsc.hadoopConfiguration().set("fs.s3n.awsSecretAccessKey", "")
  3.  
  4. # Read data from a table
  5. df = sqlContext.read \
  6. .format("com.databricks.spark.redshift") \
  7. .option("url", "jdbc:redshift://url:5439/probes?user=username&password=password") \
  8. .option("query", "select * from cloudtraxwebhook") \
  9. .option('forward_spark_s3_credentials',True) \
  10. .option("tempdir", "s3n://ncompass-cloudtrax3/tmp/") \
  11. .load()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement