Peng-Lei commented on a change in pull request #34719: URL: https://github.com/apache/spark/pull/34719#discussion_r782752672
########## File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/ShowCreateTableSuite.scala ########## @@ -15,51 +15,23 @@ * limitations under the License. */ -package org.apache.spark.sql.hive +package org.apache.spark.sql.hive.execution.command -import org.apache.spark.sql.{AnalysisException, ShowCreateTableSuite} +import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.catalog.CatalogTable -import org.apache.spark.sql.hive.test.TestHiveSingleton -import org.apache.spark.sql.internal.{HiveSerDe, SQLConf} +import org.apache.spark.sql.execution.command.v1 +import org.apache.spark.sql.hive.HiveExternalCatalog +import org.apache.spark.sql.internal.HiveSerDe -class HiveShowCreateTableSuite extends ShowCreateTableSuite with TestHiveSingleton { - - private var origCreateHiveTableConfig = false - - protected override def beforeAll(): Unit = { - super.beforeAll() - origCreateHiveTableConfig = - spark.conf.get(SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT) - spark.conf.set(SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT.key, true) - } - - protected override def afterAll(): Unit = { - spark.conf.set( - SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT.key, - origCreateHiveTableConfig) - super.afterAll() - } - - test("view") { - Seq(true, false).foreach { serde => - withView("v1") { - sql("CREATE VIEW v1 AS SELECT 1 AS a") - checkCreateView("v1", serde) - } - } - } - - test("view with output columns") { - Seq(true, false).foreach { serde => - withView("v1") { - sql("CREATE VIEW v1 (a, b COMMENT 'b column') AS SELECT 1 AS a, 2 AS b") - checkCreateView("v1", serde) - } - } - } +/** + * The class contains tests for the `SHOW CREATE TABLE` command to check V1 Hive external + * table catalog. + */ +class ShowCreateTableSuite extends v1.ShowCreateTableSuiteBase with CommandSuiteBase { + override def commandVersion: String = super[ShowCreateTableSuiteBase].commandVersion - test("view with table comment and properties") { + test("PERSISTED VIEW") { Review comment: 1. `sql/ShowCreateTableSuite.scala` move to `v1.ShowCreateTableSuiteBase` to test for V1/Hive. if the test case also work for V2. then move to `command.ShowCreateTableSuiteBase` 2. Most of `HiveShowCreateTableSuite.scala` test case only work in Hive. So move to `hive.ShowCreateTableSuite`, try to test every test case whether work in V2/V1, If it works ok for V2/V1, then move to base. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org