-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add jdbcutils class, upgrade to spark 3.3 * replace usages of createconnectionfactory with new createconnection * added integration test for the jdbc connection * refactored test dir * added read write integration test * bump package version * add version to the readme * add version to the other table in the readme * fix typo in readme * add newline * removed integration tests and readme changes, update profile name
- Loading branch information
1 parent
9a07172
commit 52d96f7
Showing
10 changed files
with
66 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/scala/com/microsoft/sqlserver/jdbc/spark/utils/JdbcUtils.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.microsoft.sqlserver.jdbc.spark.utils | ||
|
||
import org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions | ||
import org.apache.spark.sql.jdbc.JdbcDialects | ||
|
||
import java.sql.Connection | ||
|
||
object JdbcUtils { | ||
/** | ||
* Creates a JDBC connection using the input JDBC options. | ||
* @param options The options which are used to create the connection. | ||
* @return A JDBC connection. | ||
*/ | ||
def createConnection(options: JDBCOptions): Connection = { | ||
val dialect = JdbcDialects.get(options.url) | ||
val conn = dialect.createConnectionFactory(options)(-1) | ||
conn | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters