Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions connector/docker-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@
<artifactId>ojdbc17</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<!-- TODO(SPARK-55707: Re-enable DB2 JDBC Driver tests) -->
<!--dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
<scope>test</scope>
</dependency>
</dependency-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ import java.math.BigDecimal
import java.sql.{Connection, Date, Timestamp}
import java.util.Properties

import org.scalatest.Ignore

import org.apache.spark.sql.{Row, SaveMode}
import org.apache.spark.sql.catalyst.util.CharVarcharUtils
import org.apache.spark.sql.catalyst.util.DateTimeTestUtils._
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.sql.types.{ByteType, ShortType, StructType}
import org.apache.spark.tags.DockerTest

/**
* To run this test suite for a specific version (e.g., icr.io/db2_community/db2:11.5.9.0):
Expand All @@ -36,7 +37,7 @@ import org.apache.spark.tags.DockerTest
* "docker-integration-tests/testOnly org.apache.spark.sql.jdbc.DB2IntegrationSuite"
* }}}
*/
@DockerTest
Comment thread
pan3793 marked this conversation as resolved.
@Ignore // TODO(SPARK-55707): Re-enable DB2 JDBC Driver tests
class DB2IntegrationSuite extends SharedJDBCIntegrationSuite {
override val db = new DB2DatabaseOnDocker

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import javax.security.auth.login.Configuration
import com.github.dockerjava.api.model.{AccessMode, Bind, ContainerConfig, HostConfig, Volume}
import org.apache.hadoop.security.{SecurityUtil, UserGroupInformation}
import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod.KERBEROS
import org.scalatest.Ignore

import org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions
import org.apache.spark.sql.execution.datasources.jdbc.connection.{DB2ConnectionProvider, SecureConnectionProvider}
Expand All @@ -37,6 +38,7 @@ import org.apache.spark.tags.DockerTest
* "docker-integration-tests/testOnly *DB2KrbIntegrationSuite"
* }}}
*/
@Ignore // TODO(SPARK-55707: Re-enable DB2 JDBC Driver tests)
@DockerTest
class DB2KrbIntegrationSuite extends DockerKrbJDBCIntegrationSuite {
override protected val userName = s"db2/$dockerIp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ package org.apache.spark.sql.jdbc.v2
import java.sql.Connection
import java.util.Locale

import org.scalatest.Ignore

import org.apache.spark.SparkConf
import org.apache.spark.sql.AnalysisException
import org.apache.spark.sql.execution.datasources.v2.jdbc.JDBCTableCatalog
import org.apache.spark.sql.jdbc.DB2DatabaseOnDocker
import org.apache.spark.sql.types._
import org.apache.spark.tags.DockerTest

/**
* To run this test suite for a specific version (e.g., icr.io/db2_community/db2:11.5.9.0):
Expand All @@ -34,7 +35,7 @@ import org.apache.spark.tags.DockerTest
* ./build/sbt -Pdocker-integration-tests "testOnly *v2.DB2IntegrationSuite"
* }}}
*/
@DockerTest
@Ignore // TODO(SPARK-55707): Re-enable DB2 JDBC Driver tests
Comment thread
pan3793 marked this conversation as resolved.
class DB2IntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCTest {

// Following tests are disabled for both single and multiple partition read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import java.sql.Connection

import scala.jdk.CollectionConverters._

import org.scalatest.Ignore

import org.apache.spark.sql.jdbc.{DB2DatabaseOnDocker, DockerJDBCIntegrationSuite}
import org.apache.spark.sql.util.CaseInsensitiveStringMap
import org.apache.spark.tags.DockerTest
Expand All @@ -32,14 +34,16 @@ import org.apache.spark.tags.DockerTest
* ./build/sbt -Pdocker-integration-tests "testOnly *v2.DB2NamespaceSuite"
* }}}
*/
@Ignore // TODO(SPARK-55707): Re-enable DB2 JDBC Driver tests
@DockerTest
class DB2NamespaceSuite extends DockerJDBCIntegrationSuite with V2JDBCNamespaceTest {
override val db = new DB2DatabaseOnDocker
val map = new CaseInsensitiveStringMap(
Map("url" -> db.getJdbcUrl(dockerIp, externalPort),
"driver" -> "com.ibm.db2.jcc.DB2Driver").asJava)

catalog.initialize("db2", map)
// TODO(SPARK-55707): Re-enable DB2 JDBC Driver tests
// catalog.initialize("db2", map)

override def dataPreparation(conn: Connection): Unit = {}

Expand Down
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1357,12 +1357,13 @@
<version>${postgresql.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- TODO(SPARK-55707: Re-enable DB2 JDBC Driver tests) -->
<!--dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
<version>${db2.jcc.version}</version>
<scope>test</scope>
</dependency>
</dependency-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
Expand Down
5 changes: 3 additions & 2 deletions sql/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,12 @@
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<!-- TODO(SPARK-55707: Re-enable DB2 JDBC Driver tests) -->
<!--dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
<scope>test</scope>
</dependency>
</dependency-->
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,28 +185,28 @@ class ConnectionProviderSuite
val postgresDriver = registerDriver(postgresProvider.driverClass)
val postgresOptions = options("jdbc:postgresql://localhost/postgres")
val postgresAppEntry = postgresProvider.appEntry(postgresDriver, postgresOptions)
val db2Provider = new DB2ConnectionProvider()
val db2Driver = registerDriver(db2Provider.driverClass)
val db2Options = options("jdbc:db2://localhost/db2")
val db2AppEntry = db2Provider.appEntry(db2Driver, db2Options)
val mysqlProvider = new MariaDBConnectionProvider()
val mysqlDriver = registerDriver(mysqlProvider.driverClass)
val mysqlOptions = options("jdbc:mysql://localhost/db")
val mysqlAppEntry = mysqlProvider.appEntry(mysqlDriver, mysqlOptions)

// Make sure no authentication for the databases are set
val rootConfig = Configuration.getConfiguration
assert(rootConfig.getAppConfigurationEntry(postgresAppEntry) == null)
assert(rootConfig.getAppConfigurationEntry(db2AppEntry) == null)
assert(rootConfig.getAppConfigurationEntry(mysqlAppEntry) == null)

postgresProvider.setAuthenticationConfig(postgresDriver, postgresOptions)
val postgresConfig = Configuration.getConfiguration

db2Provider.setAuthenticationConfig(db2Driver, db2Options)
val db2Config = Configuration.getConfiguration
mysqlProvider.setAuthenticationConfig(mysqlDriver, mysqlOptions)
val mysqlConfig = Configuration.getConfiguration

// Make sure authentication for the databases are set
assert(rootConfig != postgresConfig)
assert(rootConfig != db2Config)
assert(rootConfig != mysqlConfig)
// The topmost config in the chain is linked with all the subsequent entries
assert(db2Config.getAppConfigurationEntry(postgresAppEntry) != null)
assert(db2Config.getAppConfigurationEntry(db2AppEntry) != null)
assert(mysqlConfig.getAppConfigurationEntry(postgresAppEntry) != null)
assert(mysqlConfig.getAppConfigurationEntry(mysqlAppEntry) != null)

Configuration.setConfiguration(null)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

package org.apache.spark.sql.execution.datasources.jdbc.connection

import org.scalatest.Ignore

@Ignore // TODO(SPARK-55707): Re-enable DB2 JDBC Driver tests
class DB2ConnectionProviderSuite extends ConnectionProviderSuiteBase {
test("setAuthenticationConfig must set authentication all the time") {
val provider = new DB2ConnectionProvider()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,8 @@ class JDBCSuite extends QueryTest with SharedSparkSession {
"SELECT TOP (123) a,b FROM test")
}

test("SPARK-42534: DB2Dialect Limit query test") {
// TODO(SPARK-55707): Re-enable DB2 JDBC Driver tests
ignore("SPARK-42534: DB2Dialect Limit query test") {
// JDBC url is a required option but is not used in this test.
val options = new JDBCOptions(Map("url" -> "jdbc:db2://host:port", "dbtable" -> "test"))
assert(
Expand Down Expand Up @@ -2261,7 +2262,9 @@ class JDBCSuite extends QueryTest with SharedSparkSession {
}
// not supported
Seq(
"jdbc:db2://host:port", "jdbc:derby:memory", "jdbc:h2://host:port",
// TODO(SPARK-55707): Re-enable DB2 JDBC Driver tests
// "jdbc:db2://host:port",
"jdbc:derby:memory", "jdbc:h2://host:port",
"jdbc:sqlserver://host:port", "jdbc:postgresql://host:5432/postgres",
"jdbc:snowflake://host:443?account=test", "jdbc:teradata://host:port").foreach { url =>
val options = new JDBCOptions(baseParameters + ("url" -> url))
Expand All @@ -2282,7 +2285,8 @@ class JDBCSuite extends QueryTest with SharedSparkSession {
"jdbc:mysql",
"jdbc:postgresql",
"jdbc:sqlserver",
"jdbc:db2",
// TODO(SPARK-55707): Re-enable DB2 JDBC Driver tests
// "jdbc:db2",
"jdbc:h2",
"jdbc:teradata",
"jdbc:databricks"
Expand Down