wzhfy commented on a change in pull request #28029: [SPARK-31261][SQL] Avoid 
npe when reading bad csv input with `columnNameCorruptRecord` specified
URL: https://github.com/apache/spark/pull/28029#discussion_r399639618
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala
 ##########
 @@ -1895,6 +1895,13 @@ abstract class CSVSuite extends QueryTest with 
SharedSparkSession with TestCsvDa
     checkAnswer(spark.read.schema(schema).csv(input), Row(null))
     checkAnswer(spark.read.option("multiLine", 
true).schema(schema).csv(input), Row(null))
     assert(spark.read.csv(input).collect().toSet == Set(Row()))
+
+    val schemaWithCorruptField = schema.add("_corrupt_record", StringType)
 
 Review comment:
   ok

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to