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

    https://github.com/apache/spark/pull/22320#discussion_r214751930
  
    --- 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)))
    +      }
    +    }
    +  }
    +
    +  test("Insert into Hive directory should output correct schema") {
    +    withTable("tbl") {
    +      withView("view1") {
    +        withTempPath { path =>
    +          spark.sql("CREATE TABLE tbl(id long)")
    +          spark.sql("INSERT OVERWRITE TABLE tbl SELECT 4")
    --- End diff --
    
    `s/SELECT/VALUES` as it could be a bit more Spark-idiomatic?


---

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

Reply via email to