Skip to content

Commit 8f33e02

Browse files
committed
Address comment.
1 parent d1f914e commit 8f33e02

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,23 +1268,19 @@ class DataSourceV2SQLSuite
12681268
}
12691269
}
12701270

1271-
private def testV1Command(sqlCommand: String, sqlParams: String): Unit = {
1272-
val e = intercept[AnalysisException] {
1273-
sql(s"$sqlCommand $sqlParams")
1274-
}
1275-
assert(e.message.contains(s"$sqlCommand is only supported with v1 tables"))
1276-
}
1277-
12781271
test("SHOW CREATE TABLE") {
12791272
val t = "testcat.ns1.ns2.tbl"
12801273
withTable(t) {
12811274
spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo")
1275+
testV1Command("SHOW CREATE TABLE", s"$t")
1276+
}
1277+
}
12821278

1283-
val e = intercept[AnalysisException] {
1284-
sql(s"SHOW CREATE TABLE $t")
1285-
}
1286-
assert(e.message.contains("SHOW CREATE TABLE is only supported with v1 tables"))
1279+
private def testV1Command(sqlCommand: String, sqlParams: String): Unit = {
1280+
val e = intercept[AnalysisException] {
1281+
sql(s"$sqlCommand $sqlParams")
12871282
}
1283+
assert(e.message.contains(s"$sqlCommand is only supported with v1 tables"))
12881284
}
12891285

12901286
private def assertAnalysisError(sqlStatement: String, expectedError: String): Unit = {

0 commit comments

Comments
 (0)