srowen commented on issue #24872: [SPARK-28023][SQL] Trim the string when cast 
string type to Boolean/Numeric types
URL: https://github.com/apache/spark/pull/24872#issuecomment-502407234
 
 
   Taking a step back: is there a correct behavior? does Hive or a SQL standard 
suggest that " 3.0" should cast correctly to a double? if so, then there is no 
question that this is a fix, and we shouldn't offer a flag to make the behavior 
incorrect.
   
   Is there not a clear correct behavior? then don't enforce it in Spark. 
Callers trim() input if needed, or don't if it isn't. No call for a flag there.
   
   The perf question probably doesn't matter, then, either way.
   
   Oh, this is `UTF8String.trim()`. Looks like there are some obvious 
optimizations here to avoid a copy, like `String.trim()`. It doesn't even 
optimize for the common case. I'll try that in a separate PR, as that will be 
worthwhile no matter what.

----------------------------------------------------------------
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