MaxGekk commented on code in PR #48653:
URL: https://github.com/apache/spark/pull/48653#discussion_r1816618015
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/UnivocityParser.scala:
##########
@@ -179,16 +179,16 @@ class UnivocityParser(
dataType: DataType,
nullable: Boolean = true): ValueConverter = dataType match {
case _: ByteType => (d: String) =>
- nullSafeDatum(d, name, nullable, options)(_.toByte)
+ nullSafeDatum(d, name, nullable, options)(_.trim.toByte)
Review Comment:
All the trims might lead to perf regressions. Need to update results of CSV
benchmark, I guess.
##########
sql/core/src/test/scala/org/apache/spark/sql/CsvFunctionsSuite.scala:
##########
@@ -485,7 +486,7 @@ class CsvFunctionsSuite extends QueryTest with
SharedSparkSession {
test("SPARK-32968: bad csv input with csv pruning optimization") {
Seq("true", "false").foreach { enabled =>
withSQLConf(SQLConf.CSV_EXPRESSION_OPTIMIZATION.key -> enabled) {
- val df =
sparkContext.parallelize(Seq("1,\u0001\u0000\u0001234")).toDF("csv")
+ val df =
sparkContext.parallelize(Seq("1,\u0001\u0000\u0001234X")).toDF("csv")
Review Comment:
why do you need to change this?
--
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]