GitHub user lins05 opened a pull request:
https://github.com/apache/spark/pull/16893
[SPARK-19555][SQL] Improve the performance of StringUtils.escapeLikeRegex
method
## What changes were proposed in this pull request?
Copied from [SPARK-19555](https://issues.apache.org/jira/browse/SPARK-19555)
Spark's `StringUtils.escapeLikeRegex()` method is written inefficiently,
performing tons of object allocations due to the use `zip()`, `flatMap()` , and
`mkString`. Instead, I think method should be rewritten in an imperative style
using a Java string builder.
This method can become a performance bottleneck in cases where regex
expressions are used with non-constant-foldable expressions (e.g. the regex
expression comes from the data rather than being part of the query).
## How was this patch tested?
Existing tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/lins05/spark
spark-19555-improve-escape-like-regex
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/16893.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #16893
----
commit bbcdeda98c14705b6de3efab70f2c58bc4539bb9
Author: Shuai Lin <[email protected]>
Date: 2017-02-11T07:46:34Z
[SPARK-19555][SQL] Improve the performance of StringUtils.escapeLikeRegex
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]