Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/18200
  
    Let me give the example here. 
    Case 1:
    ```Scala
        val corruptCVSRecords: Dataset[String] =
          spark.createDataset(spark.sparkContext.parallelize(
            """1, "b"""" ::
              """2015""" :: Nil))(Encoders.STRING)
    ```
    
    Case 2:
    ```Scala
        val corruptCVSRecords: Dataset[String] =
          spark.createDataset(spark.sparkContext.parallelize(
            """1, "b"""" ::
              """2""" :: Nil))(Encoders.STRING)
    ```
    
    When passing the `corruptCVSRecords ` of Case 1, it works well; however, if 
we change it to case 2, it failed. 
    ```Scala
        val df1 = spark.read
          .schema("col1 int, col2 String, __corrupted_column_name string")
          .option("columnNameOfCorruptRecord", "__corrupted_column_name")
          .option("mode", PermissiveMode.name)
          .csv(corruptCVSRecords)
        df1.show()
    ```


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