MaxGekk commented on a change in pull request #25184: [SPARK-28431][SQL] Set
meximum error message length in CSV datasource's parsing and writing
URL: https://github.com/apache/spark/pull/25184#discussion_r305633949
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala
##########
@@ -2085,4 +2087,28 @@ class CSVSuite extends QueryTest with SharedSQLContext
with SQLTestUtils with Te
}
}
}
+
+ test("SPARK-28431: prevent CSV datasource throw TextParsingException with
large size message") {
+ withTempDir { dir =>
+ val maxCharsPerCol = 10000
+ val str = "a" * (maxCharsPerCol + 1)
+
+ val csvFile = new File(dir, "data.csv")
+ Files.write(
+ csvFile.toPath,
+ Seq(str).asJava,
Review comment:
nit: `str.getBytes()`?
----------------------------------------------------------------
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]