GitHub user dongjoon-hyun opened a pull request:

    https://github.com/apache/spark/pull/17106

    [SPARK-19775][SQL] Remove an obsolete `partitionBy().insertInto()` test case

    ## What changes were proposed in this pull request?
    
    This issue removes [a test 
case](https://github.com/apache/spark/blame/master/sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertIntoHiveTableSuite.scala#L287-L298)
 which was introduced by 
[SPARK-16033](https://github.com/apache/spark/commit/10b671447bc04af250cbd8a7ea86f2769147a78a)
 and was superseded by 
[SPARK-14459](https://github.com/apache/spark/blame/master/sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertIntoHiveTableSuite.scala#L365-L371).
 Basically, we cannot use `partitionBy` and `insertInto` together.
    
    ```scala
      test("Reject partitioning that does not match table") {
        withSQLConf(("hive.exec.dynamic.partition.mode", "nonstrict")) {
          sql("CREATE TABLE partitioned (id bigint, data string) PARTITIONED BY 
(part string)")
          val data = (1 to 10).map(i => (i, s"data-$i", if ((i % 2) == 0) 
"even" else "odd"))
              .toDF("id", "data", "part")
    
          intercept[AnalysisException] {
            // cannot partition by 2 fields when there is only one in the table 
definition
            data.write.partitionBy("part", "data").insertInto("partitioned")
          }
        }
      }
    ```
    
    
    ## How was this patch tested?
    
    This only removes a test case. Pass the existing Jenkins test.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dongjoon-hyun/spark SPARK-19775

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/17106.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17106
    
----
commit 62768180c649f77144138f4b7bcdc72cdd4f4f71
Author: Dongjoon Hyun <[email protected]>
Date:   2017-02-28T22:47:03Z

    [SPARK-19775][SQL] Remove an obsolete `partitionBy().insertInto()` test case

----


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to