srowen commented on a change in pull request #26626: [SPARK-29986][SQL]
Introduce java like string trim to UTF8String
URL: https://github.com/apache/spark/pull/26626#discussion_r349067435
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/postgreSQL/PostgreCastToBoolean.scala
##########
@@ -42,7 +42,7 @@ case class PostgreCastToBoolean(child: Expression,
timeZoneId: Option[String])
override def castToBoolean(from: DataType): Any => Any = from match {
case StringType =>
buildCast[UTF8String](_, str => {
- val s = str.trim().toLowerCase()
+ val s = str.trimAll().toLowerCase()
Review comment:
Are these really the only cases that should trim this way?
----------------------------------------------------------------
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]