itholic commented on code in PR #39258:
URL: https://github.com/apache/spark/pull/39258#discussion_r1063124561
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala:
##########
@@ -3138,13 +3141,54 @@ class CSVv1Suite extends CSVSuite {
super
.sparkConf
.set(SQLConf.USE_V1_SOURCE_LIST, "csv")
+
+ private val carsFile = "test-data/cars.csv"
+
+ test("test for FAILFAST parsing mode on CSV v1") {
+ Seq(false, true).foreach { multiLine =>
+ val exception = intercept[SparkException] {
+ spark.read
+ .format("csv")
+ .option("multiLine", multiLine)
+ .options(Map("header" -> "true", "mode" -> "failfast"))
+ .load(testFile(carsFile)).collect()
+ }
+
+ checkError(
+ exception = exception.getCause.asInstanceOf[SparkException],
+ errorClass = "_LEGACY_ERROR_TEMP_2177",
+ parameters = Map("failFastMode" -> "FAILFAST")
+ )
+ }
+ }
}
class CSVv2Suite extends CSVSuite {
override protected def sparkConf: SparkConf =
super
.sparkConf
.set(SQLConf.USE_V1_SOURCE_LIST, "")
+
+ private val carsFile = "test-data/cars.csv"
+
+ test("test for FAILFAST parsing mode on CSV v2") {
+ Seq(false, true).foreach { multiLine =>
+ val exception = intercept[SparkException] {
+ spark.read
+ .format("csv")
+ .option("multiLine", multiLine)
+ .options(Map("header" -> "true", "mode" -> "failfast"))
+ .load(testFile(carsFile)).collect()
+ }
+
+ checkError(
+ exception = exception.getCause.asInstanceOf[SparkException],
+ errorClass = "_LEGACY_ERROR_TEMP_2064",
Review Comment:
Yeah, it's because of the same reason with the above. Do we want to do it in
separate PR and revert it from here?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]