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

    https://github.com/apache/spark/pull/22320#discussion_r214828496
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala 
---
    @@ -754,6 +754,47 @@ class HiveDDLSuite
         }
       }
     
    +  test("Insert overwrite Hive table should output correct schema") {
    +    withTable("tbl", "tbl2") {
    +      withView("view1") {
    +        spark.sql("CREATE TABLE tbl(id long)")
    +        spark.sql("INSERT OVERWRITE TABLE tbl SELECT 4")
    +        spark.sql("CREATE VIEW view1 AS SELECT id FROM tbl")
    +        spark.sql("CREATE TABLE tbl2(ID long)")
    +        spark.sql("INSERT OVERWRITE TABLE tbl2 SELECT ID FROM view1")
    +        checkAnswer(spark.table("tbl2"), Seq(Row(4)))
    --- End diff --
    
    Good point. I found that `CreateHiveTableAsSelectCommand` output wrong 
schema after adding a new test case.


---

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

Reply via email to