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

    https://github.com/apache/spark/pull/7342#discussion_r34711225
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala 
---
    @@ -761,4 +761,43 @@ class DataFrameSuite extends QueryTest {
         assert(f.getMessage.contains("column3"))
         assert(!f.getMessage.contains("column2"))
       }
    +
    +  test("SPARK-6941: Better error message for inserting into RDD-based 
Table") {
    +    val df = Seq(Tuple1(1)).toDF()
    +    val insertion = Seq(Tuple1(2)).toDF("col")
    +
    +    // pass case: parquet table (HadoopFsRelation)
    +    df.write.mode(SaveMode.Overwrite).parquet("tmp_parquet")
    +    val pdf = ctx.read.parquet("tmp_parquet")
    +    pdf.registerTempTable("parquet_base")
    +    insertion.write.insertInto("parquet_base")
    +
    +    // pass case: json table (InsertableRelation)
    +    df.write.mode(SaveMode.Overwrite).json("tmp_json")
    +    val jdf = ctx.read.json("tmp_json")
    +    jdf.registerTempTable("json_base")
    +    insertion.write.mode(SaveMode.Overwrite).insertInto("json_base")
    +
    +    // error cases: insert into a RDD
    --- End diff --
    
    a RDD => an RDD


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