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

    https://github.com/apache/spark/pull/12855#discussion_r63466408
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertIntoHiveTableSuite.scala
 ---
    @@ -216,6 +215,33 @@ class InsertIntoHiveTableSuite extends QueryTest with 
TestHiveSingleton with Bef
         sql("DROP TABLE hiveTableWithStructValue")
       }
     
    +  test("SPARK-10216: Avoid empty files during overwrite into Hive table 
with group by query") {
    +    val testDataset = hiveContext.sparkContext.parallelize(
    +      (1 to 2).map(i => TestData(i, i.toString))).toDF()
    +    testDataset.registerTempTable("testDataset")
    +
    +    val tmpDir = Utils.createTempDir()
    +    sql(
    +      s"""
    +        |CREATE TABLE table1(key int,value string)
    +        |location '${tmpDir.toURI.toString}'
    +      """.stripMargin)
    +    sql(
    +      """
    +        |INSERT OVERWRITE TABLE table1
    +        |SELECT count(key), value FROM testDataset GROUP BY value
    --- End diff --
    
    Ah, yes. Thank you.


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