jdbc driver error when connecting msql(sql server) in spark...

Asked 1 years ago, Updated 1 years ago, 80 views

ubuntu 18.04.4LTS python 3.6.9 spark 2.4.6

When connecting to mssql after a jdbc call using a command such as spark.read.format("")... to pyspark in the environment, we used it well without any connection problems, even though we didn't set it up for the jdbc driver.

at present ubuntu 16.04.4LTS python 3.5.2 spark 2.4.6 The environment is approaching with the same grammar, but an error occurs as in the following picture. I downloaded the msql-jdbc-8.2.jre8.jar file just in case, but it still doesn't work...What's the difference from the previous version?

python python3.5 python3.6 ubuntu

2022-09-20 20:18

1 Answers

Spark works with jvm. You should know Java to some extent in order to troubleshoot about Spark.

The above error is caused by the failure to find the required class in classpath when looking for the class in jvm.

Please test on the spark shell as below to see if you have the jdbc driver jar file and add it if you don't.

System.getProperty("java.class.path").split(":").foreach(println)


2022-09-20 20:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.