vikashbissu007
vikashbissu007

Reputation: 23

how to add the Postgresql JDBC driver jar to the classpath Within the Spark Shell?

I am trying to add Postgresql jar to spark shell using "scala> :require < path_to_postgresql-42.0.0.jar >" but it showing error "< console >:1: error: ';' expected but double literal found" any suggestion ??

Upvotes: 0

Views: 1394

Answers (1)

Duy Nguyen
Duy Nguyen

Reputation: 1005

There are some way to add your dependencies

1st add package as dependency

Spark will pull package from maven center for you

spark-shell --packages org.postgresql:postgresql:42.0.0

2nd add jars to your spark shell

Change the path to your case

spark-shell --jars /YOUR/PATH/postgresql-42.0.0.jar

Upvotes: 3

Related Questions