How can I connecta postgreSQL database into Apache Spark using scala? - Stack Overflow

PHOTO EMBED

Tue Aug 10 2021 13:28:39 GMT+0000 (Coordinated Universal Time)

Saved by @Zyglak #scala #spark #postgresql

val classes = Seq(
  getClass,                   // To get the jar with our own code.
  classOf[mysql.jdbc.Driver]  // To get the connector.
)
val jars = classes.map(_.getProtectionDomain().getCodeSource().getLocation().getPath())
val conf = new SparkConf().setJars(jars)
content_copyCOPY

https://stackoverflow.com/questions/24916852/how-can-i-connect-to-a-postgresql-database-into-apache-spark-using-scala