Skip to content

Instantly share code, notes, and snippets.

@marhan
Created April 18, 2017 21:06
Show Gist options
  • Save marhan/ab6409cfe3000b7c8a9aaf0e55c013bb to your computer and use it in GitHub Desktop.
Save marhan/ab6409cfe3000b7c8a9aaf0e55c013bb to your computer and use it in GitHub Desktop.
Export spark data frame into PostgreSQL database (Zeppelin paragraph)
%spark
data.write
.format("jdbc")
.option("url", "jdbc:postgresql://SERVER:5432/DATABASE")
.option("dbtable", "public.account")
.option("user", "zeppelin")
.option("password", "PASSWORD")
.option("driver", "org.postgresql.Driver")
.mode("overwrite")
.save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment