You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by hu...@apache.org on 2022/07/04 15:45:36 UTC
[spark] branch master updated: [MINOR][SQL][TESTS] Remove unused super class & unused variable in JDBCXXXSuite
This is an automated email from the ASF dual-hosted git repository.
huaxingao 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 dabe57eca87 [MINOR][SQL][TESTS] Remove unused super class & unused variable in JDBCXXXSuite
dabe57eca87 is described below
commit dabe57eca879f7f8bfbdeb158450b6188ee4e2c7
Author: panbingkun <pb...@gmail.com>
AuthorDate: Mon Jul 4 08:45:18 2022 -0700
[MINOR][SQL][TESTS] Remove unused super class & unused variable in JDBCXXXSuite
### What changes were proposed in this pull request?
> Remove unused super class "BeforeAndAfter" & " PrivateMethodTester" in JDBCSuite
> Remove unused variable "conn" in JDBCV2Suite & JDBCTableCatalogSuite
### Why are the changes needed?
Eliminate redundant information and make the code cleaner
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass GA
Closes #37062 from panbingkun/minor-jdbcsuites.
Authored-by: panbingkun <pb...@gmail.com>
Signed-off-by: huaxingao <hu...@apple.com>
---
.../sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala | 1 -
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala | 4 +---
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala | 1 -
3 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala
index 8d8d13211fd..7aa8adc07ed 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala
@@ -35,7 +35,6 @@ class JDBCTableCatalogSuite extends QueryTest with SharedSparkSession {
val tempDir = Utils.createTempDir()
val url = s"jdbc:h2:${tempDir.getCanonicalPath};user=testUser;password=testPass"
val defaultMetadata = new MetadataBuilder().putLong("scale", 0).build()
- var conn: java.sql.Connection = null
override def sparkConf: SparkConf = super.sparkConf
.set("spark.sql.catalog.h2", classOf[JDBCTableCatalog].getName)
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala
index 494ae6d5487..b87fee6cec2 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala
@@ -26,7 +26,6 @@ import scala.collection.JavaConverters._
import org.mockito.ArgumentMatchers._
import org.mockito.Mockito._
-import org.scalatest.{BeforeAndAfter, PrivateMethodTester}
import org.apache.spark.SparkException
import org.apache.spark.sql.{AnalysisException, DataFrame, QueryTest, Row}
@@ -45,8 +44,7 @@ import org.apache.spark.sql.test.SharedSparkSession
import org.apache.spark.sql.types._
import org.apache.spark.util.Utils
-class JDBCSuite extends QueryTest
- with BeforeAndAfter with PrivateMethodTester with SharedSparkSession {
+class JDBCSuite extends QueryTest with SharedSparkSession {
import testImplicits._
val url = "jdbc:h2:mem:testdb0"
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala
index 90ab976d9d5..1cc5f87e5fc 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala
@@ -44,7 +44,6 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
val tempDir = Utils.createTempDir()
val url = s"jdbc:h2:${tempDir.getCanonicalPath};user=testUser;password=testPass"
- var conn: java.sql.Connection = null
val testH2Dialect = new JdbcDialect {
override def canHandle(url: String): Boolean = H2Dialect.canHandle(url)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org