AFAIK, you can read data from DB with JdbcRDD, but there is no interface for writing to DB. JdbcRDD has some restrict such as SQL must with "where" clause. For writing to DB, you can use mapPartitions or foreachPartition to implement. You can refer this example: http://stackoverflow.com/questions/24916852/how-can-i-connect-to-a-postgresql-database-into-apache-spark-using-scala
2014-10-30 23:01 GMT+08:00 Asaf Lahav <asaf.la...@gmail.com>: > Hi Ladies and Gents, > I would like to know what are the options I have if I would like to > leverage Spark code I already have written to use a DB (Vertica) as its > store/datasource. > The data is of tabular nature. So any relational DB can essentially be > used. > > Do I need to develop a context? If yes, how? where can I get a good > example? > > > Thank you, > Asaf >