I'm trying to load data from MS SQL server using pyspark in Jupyter Notebook. Spark is tested and works fine. I'm using following:
from pyspark import SparkContext, SparkConf, SQLContext
appName = "PySpark SQL Server Example - via JDBC"
master = "local"
conf = SparkConf() \
.setAppName(appName) \
.setMaster(master) \
.set("spark.driver.extraClassPath","mssql-jdbc-7.4.1.jre8.jar")
sc = SparkContext.getOrCreate(conf=conf)
sqlContext = SQLContext(sc)
spark = sqlContext.sparkSession
# Loading data from a JDBC source
jdbcDF = spark.read \
.format("jdbc") \
.option("url", "jdbc:postgresql:dbserver") \
.option("url", "jdbc:sqlserver://188.188.188.188:10004;databaseName=dbnme") \
.option("dbtable", "dbo.tablename") \
.option("user", "usernmame") \
.option("password", "pawwrod") \
.load()
My MS SQL driver (mssql-jdbc-7.4.1.jre8.jar
) jar is in the same location where my python script is.
Errors I get:
and: