Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-19775

Remove an obsolete `partitionBy().insertInto()` test case

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 2.1.0
    • 2.2.0
    • SQL, Tests
    • None

    Description

      This issue removes a test case which was introduced by SPARK-14459 and was superseded by SPARK-16033. Basically, we cannot use `partitionBy` and `insertInto` together.

        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")
            }
          }
        }
      

      Attachments

        Activity

          People

            dongjoon Dongjoon Hyun
            dongjoon Dongjoon Hyun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: