Github user ouyangxiaochen commented on a diff in the pull request: https://github.com/apache/spark/pull/16638#discussion_r99984076 --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala --- @@ -812,150 +812,234 @@ class HiveDDLSuite } } - test("CREATE TABLE LIKE a temporary view") { - val sourceViewName = "tab1" - val targetTabName = "tab2" - withTempView(sourceViewName) { - withTable(targetTabName) { - spark.range(10).select('id as 'a, 'id as 'b, 'id as 'c, 'id as 'd) - .createTempView(sourceViewName) - sql(s"CREATE TABLE $targetTabName LIKE $sourceViewName") - - val sourceTable = spark.sessionState.catalog.getTempViewOrPermanentTableMetadata( - TableIdentifier(sourceViewName)) - val targetTable = spark.sessionState.catalog.getTableMetadata( - TableIdentifier(targetTabName, Some("default"))) - - checkCreateTableLike(sourceTable, targetTable) + test("CREATE TABLE LIKE a temporary view [LOCATION]...") { + var createdTableType = "MANAGED" + for ( i <- 0 to 1 ) { --- End diff -- I write this for the purpose of reusing this piece of public code, because the basic logic of these two scenarios are almost the same.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org