You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/24 23:09:57 UTC

[GitHub] [spark] dilipbiswal commented on a change in pull request #26219: [SPARK-29563][SQL] CREATE TABLE LIKE should look up catalog/table like v2 commands

dilipbiswal commented on a change in pull request #26219: [SPARK-29563][SQL] CREATE TABLE LIKE should look up catalog/table like v2 commands
URL: https://github.com/apache/spark/pull/26219#discussion_r338829208
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala
 ##########
 @@ -1254,6 +1254,30 @@ class DataSourceV2SQLSuite
     }
   }
 
+  test("CREATE TABLE LIKE") {
+    val targetTable = "testcat.ns1.ns2.tbl1"
+    val sourceTable = "testcat.ns1.ns2.tbl2"
+    withTable(targetTable, sourceTable) {
+      val e1 = intercept[AnalysisException] {
+        sql(s"CREATE TABLE $targetTable LIKE $sourceTable")
+      }
+      assert(e1.message.contains("CREATE TABLE LIKE is only supported with v1 tables"))
+
+      val e2 = intercept[AnalysisException] {
+        sql(s"CREATE TABLE IF NOT EXISTS $targetTable LIKE $sourceTable")
+      }
+      assert(e2.message.contains("CREATE TABLE LIKE is only supported with v1 tables"))
+
+      withTempDir { tmpDir =>
 
 Review comment:
   @dongjoon-hyun Actually its not required. I have removed it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org