lyy-pineapple opened a new pull request, #38171:
URL: https://github.com/apache/spark/pull/38171

   
   ### What changes were proposed in this pull request?
   Refer to patch:https://github.com/apache/spark/pull/8715 to improve regular 
expression  @watermen 
   The joni regex engine (https://github.com/jruby/joni), a Java port of 
Oniguruma regexp library done by the JRuby project, is:
   
   - MIT licensed
   - Designed to work with byte[] arguments instead of String
   - Capable of handling UTF8 encoding
   - Regex syntax compatible
   - Interruptible
   - Much faster than j.u.regex
   - Has JRuby's jcodings library as a dependency, also MIT licensed
   
   | hProperty Name | Default | Meaning |
   | ------ | ------ | ------ |
   | spark.sql.regex.engine | spark.sql.regex.engine |The regular expression 
engine for string expressions. It can be joni or java, and joni will have 
better performance than java. |
   
   For benchmark,refer to https://github.com/mariomka/regex-benchmark to test 
Joni and Java.Divide the test file into lines for regular matching.
   OpenJDK 64-Bit Server VM 1.8.0_342-8u342-b07-0ubuntu1~18.04-b07 on Linux 
5.4.0-126-generic
   Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
   | regular expression engine | Email(ms) --count | URI(ms) -- count | IP(ms) 
-- count | Total(ms) |
   | ------ | ------ | ------ | ------ | ------ |
   | java | 250.206552 -- 70 | 231.503311 -- 5174| 208.0297 -- 5| 689.739563 |
   | joni | 77.651162 -- 70 | 53.572828 -- 5174| 39.411638 -- 5| 170.635628 |
   
   Mainly optimized like, rlike and mutike.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   Test some jobs. Joni is much faster than java.
   use Joni:
   
![image](https://user-images.githubusercontent.com/46274164/194742096-f6106535-ee70-449a-b83c-5e2a4c8fc686.png)
   
   use java:
   
![image](https://user-images.githubusercontent.com/46274164/194742149-39c80b85-6277-44b5-99fc-ee6d913760ed.png)
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as 
the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes 
- provide the console output, description and/or an example to show the 
behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to 
the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   No
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some 
test cases that check the changes thoroughly including negative and positive 
cases if possible.
   If it was tested in a way different from regular unit tests, please clarify 
how you tested step by step, ideally copy and paste-able, so that other 
reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why 
it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions 
for the consistent environment, and the instructions could accord to: 
https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   add unit tests


-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to