[
https://issues.apache.org/jira/browse/SPARK-32891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17362766#comment-17362766
]
dgd_contributor commented on SPARK-32891:
-----------------------------------------
After looking into this and run a few benchmark, I don't think there is a big
different at the execution time between [UTF8String].trim().toString() and
[UTF8String].toString().trim(), as for 1000000 loop on my computer,
[UTF8String].trim().toString() execution time is 13168899600 nanoSecond and
[UTF8String].toString().trim() is 11813350700 nanoSecond
> Enhance UTF8String.trim
> -----------------------
>
> Key: SPARK-32891
> URL: https://issues.apache.org/jira/browse/SPARK-32891
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 3.1.0
> Reporter: Yuming Wang
> Priority: Major
>
> It sounds like {{UTF8String.trim}} is not implemented well. We may need to
> look at how {{java.lang.String.trim}} is implemented.
> Please see comment:
>
> [https://github.com/apache/spark/blob/7eb76d698836a251065753117e22285dd1a8aa8f/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala#L674-L675]
> [https://github.com/apache/spark/pull/29731#discussion_r487709672]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]