This is an automated email from the ASF dual-hosted git repository.

wenchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 9c9bbf6a6d60 [SPARK-50604][SQL][TESTS] Extract MariaDBDatabaseOnDocker 
and upgrade `Mariadb` docker image version
9c9bbf6a6d60 is described below

commit 9c9bbf6a6d607942009b428fcd8ea4b87c17f35d
Author: panbingkun <[email protected]>
AuthorDate: Wed Dec 18 15:42:05 2024 +0800

    [SPARK-50604][SQL][TESTS] Extract MariaDBDatabaseOnDocker and upgrade 
`Mariadb` docker image version
    
    ### What changes were proposed in this pull request?
    The pr aims to:
    - extract MariaDBDatabaseOnDocker
    - upgrade Mariadb docker image version from `10.6.19` to `10.11.10`.
    
    ### Why are the changes needed?
    - Align testing logic with other databases, eg: `DB2DatabaseOnDocker`, 
`MsSQLServerDatabaseOnDocker`, `MySQLDatabaseOnDocker`, 
`OracleDatabaseOnDocker` and `PostgresDatabaseOnDocker`.
    - Tests dependencies upgrading.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    Pass GA.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Closes #49059 from panbingkun/MariaDBDatabaseOnDocker.
    
    Authored-by: panbingkun <[email protected]>
    Signed-off-by: Wenchen Fan <[email protected]>
---
 .../spark/sql/jdbc/MariaDBDatabaseOnDocker.scala   | 33 ++++++++++++++++++++++
 .../sql/jdbc/MariaDBKrbIntegrationSuite.scala      | 11 +-------
 2 files changed, 34 insertions(+), 10 deletions(-)

diff --git 
a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MariaDBDatabaseOnDocker.scala
 
b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MariaDBDatabaseOnDocker.scala
new file mode 100644
index 000000000000..61930268eb2a
--- /dev/null
+++ 
b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MariaDBDatabaseOnDocker.scala
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.jdbc
+
+import org.apache.spark.internal.Logging
+
+abstract class MariaDBDatabaseOnDocker extends DatabaseOnDocker with Logging {
+  override val imageName: String =
+    sys.env.getOrElse("MARIADB_DOCKER_IMAGE_NAME", "mariadb:10.11.10")
+  override val env: Map[String, String] = Map(
+    "MYSQL_ROOT_PASSWORD" -> "rootpass"
+  )
+  override val usesIpc = false
+  override val jdbcPort = 3306
+
+  override def getEntryPoint: Option[String] =
+    Some("/docker-entrypoint/mariadb-docker-entrypoint.sh")
+}
diff --git 
a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MariaDBKrbIntegrationSuite.scala
 
b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MariaDBKrbIntegrationSuite.scala
index 32c552eb8c7e..962c70510b5b 100644
--- 
a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MariaDBKrbIntegrationSuite.scala
+++ 
b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MariaDBKrbIntegrationSuite.scala
@@ -37,20 +37,11 @@ class MariaDBKrbIntegrationSuite extends 
DockerKrbJDBCIntegrationSuite {
   override protected val userName = s"mariadb/$dockerIp"
   override protected val keytabFileName = "mariadb.keytab"
 
-  override val db = new DatabaseOnDocker {
-    override val imageName = sys.env.getOrElse("MARIADB_DOCKER_IMAGE_NAME", 
"mariadb:10.6.19")
-    override val env = Map(
-      "MYSQL_ROOT_PASSWORD" -> "rootpass"
-    )
-    override val usesIpc = false
-    override val jdbcPort = 3306
+  override val db = new MariaDBDatabaseOnDocker() {
 
     override def getJdbcUrl(ip: String, port: Int): String =
       s"jdbc:mysql://$ip:$port/mysql?user=$principal"
 
-    override def getEntryPoint: Option[String] =
-      Some("/docker-entrypoint/mariadb-docker-entrypoint.sh")
-
     override def beforeContainerStart(
         hostConfigBuilder: HostConfig,
         containerConfigBuilder: ContainerConfig): Unit = {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to