Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14531#discussion_r76720688
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala 
---
    @@ -620,6 +623,219 @@ class HiveDDLSuite
         }
       }
     
    +  test("CREATE TABLE LIKE a temporary table") {
    +    val sourceTabName = "tab1"
    +    val targetTabName = "tab2"
    +    withTable(sourceTabName, targetTabName) {
    +      spark.range(10).select('id as 'a, 'id as 'b, 'id as 'c, 'id as 'd)
    +        .createTempView(sourceTabName)
    +      sql(s"CREATE TABLE $targetTabName LIKE $sourceTabName")
    +
    +      val sourceTable =
    +        
spark.sessionState.catalog.getTableMetadata(TableIdentifier(sourceTabName, 
None))
    +      val targetTable =
    +        
spark.sessionState.catalog.getTableMetadata(TableIdentifier(targetTabName, 
Some("default")))
    +
    +      assert(targetTable.storage.serde ==
    --- End diff --
    
    Since the source table is temporary view, we are unable to get the serde 
from the source table and thus we choose the default one. Here, it is for 
confirming that. 


---
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

Reply via email to