maropu commented on a change in pull request #26097: [SPARK-29421][SQL] Supporting Create Table Like Using Provider URL: https://github.com/apache/spark/pull/26097#discussion_r344154231
########## File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala ########## @@ -2817,4 +2817,42 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { } } } + + test("SPARK-29421: Create Table LIKE USING provider") { + val catalog = spark.sessionState.catalog + withTable("s", "t1", "t2", "t3", "t4", "t5") { + sql("CREATE TABLE s(a INT, b INT) USING parquet") + val source = catalog.getTableMetadata(TableIdentifier("s")) + assert(source.provider == Some("parquet")) + + sql("CREATE TABLE t1 LIKE s USING orc") + val table1 = catalog.getTableMetadata(TableIdentifier("t1")) + assert(table1.provider == Some("orc")) + + sql("CREATE TABLE t2 LIKE s USING com.databricks.spark.csv") + val table2 = catalog.getTableMetadata(TableIdentifier("t2")) + assert(table2.provider == Some("com.databricks.spark.csv")) + + val e1 = intercept[ClassNotFoundException] { Review comment: Is this test the same with the test in L2841-L2844? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org