Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Spark - Reading from standalone instance of SQL Server using com.microsoft.azure #78

Closed
Gows24 opened this issue May 21, 2020 · 1 comment

Comments

@Gows24
Copy link

Gows24 commented May 21, 2020

I am trying to read from a table using com.microsoft.azure. Below is the code snippet.

MSSQL JDBC Version: mssql-jdbc-7.2.2.jre8
azure-sqldb-spark version: 1.0.2
Scala: 2.12


import com.microsoft.azure.sqldb.spark.config.Config
import com.microsoft.azure.sqldb.spark.connect._
val config = Config(Map(
      "url"          -> "jdbc:sqlserver://localhost",
      "port" -> "1433",
      "databaseName" -> "Student",
      "dbTable"      -> "dbo.MemberDetail",
      "authentication" -> "SqlPassword",
    "user"         -> "test",
    "password"     -> "****"
    ))
val df = spark.sqlContext.read.sqlDB(config)
    println("Total rows: " + df.count)

However, I am getting below error

Exception in thread "main" java.lang.NoClassDefFoundError: scala/Product$class
    at com.microsoft.azure.sqldb.spark.config.SqlDBConfigBuilder.<init>(SqlDBConfigBuilder.scala:31)
    at com.microsoft.azure.sqldb.spark.config.Config$.apply(Config.scala:254)
    at com.microsoft.azure.sqldb.spark.config.Config$.apply(Config.scala:235)
    at DbApp$.main(DbApp.scala:55)
    at DbApp.main(DbApp.scala)
@arvindshmicrosoft
Copy link
Contributor

Thank you for your question. Are you running on Spark 3.0? If so, there are no plans to support Spark 3.0.0 with this connector. Consider evaluating the
Apache Spark Connector for SQL Server and Azure SQL which is a newer connector. They are already tracking the request for Spark 3.0.0 support in the new connector.

I am closing this issue as there are no plans to address this request in this connector.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants