Skip to content

Commit

Permalink
[SPARK-34001][SQL][TESTS] Remove unused runShowTablesSql() in DataSou…
Browse files Browse the repository at this point in the history
…rceV2SQLSuite.scala

### What changes were proposed in this pull request?

After #30287, `runShowTablesSql()` in `DataSourceV2SQLSuite.scala` is no longer used. This PR removes the unused method.

### Why are the changes needed?

To remove unused method.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Existing test.

Closes #31022 from imback82/33382-followup.

Authored-by: Terry Kim <yuminkim@gmail.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
  • Loading branch information
imback82 authored and dongjoon-hyun committed Jan 5, 2021
1 parent 6b00fdc commit 15a863f
Showing 1 changed file with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import org.apache.spark.sql.internal.{SQLConf, StaticSQLConf}
import org.apache.spark.sql.internal.SQLConf.{PARTITION_OVERWRITE_MODE, PartitionOverwriteMode, V2_SESSION_CATALOG_IMPLEMENTATION}
import org.apache.spark.sql.internal.connector.SimpleTableProvider
import org.apache.spark.sql.sources.SimpleScanSource
import org.apache.spark.sql.types.{BooleanType, LongType, StringType, StructField, StructType}
import org.apache.spark.sql.types.{LongType, StringType, StructField, StructType}
import org.apache.spark.sql.util.CaseInsensitiveStringMap
import org.apache.spark.storage.StorageLevel
import org.apache.spark.unsafe.types.UTF8String
Expand Down Expand Up @@ -991,26 +991,6 @@ class DataSourceV2SQLSuite
" only SessionCatalog supports this command."))
}

private def runShowTablesSql(
sqlText: String,
expected: Seq[Row],
expectV2Catalog: Boolean = true): Unit = {
val schema = if (expectV2Catalog) {
new StructType()
.add("namespace", StringType, nullable = false)
.add("tableName", StringType, nullable = false)
} else {
new StructType()
.add("database", StringType, nullable = false)
.add("tableName", StringType, nullable = false)
.add("isTemporary", BooleanType, nullable = false)
}

val df = spark.sql(sqlText)
assert(df.schema === schema)
assert(expected === df.collect())
}

test("CreateNameSpace: basic tests") {
// Session catalog is used.
withNamespace("ns") {
Expand Down

0 comments on commit 15a863f

Please sign in to comment.