Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add experimental translation of 'LIKE' patterns to regex #98

Closed
wants to merge 1 commit into from

Conversation

jpschorr
Copy link
Contributor

Prototype sketch for converting an SQL-style LIKE expression into a regex.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jpschorr jpschorr requested review from almann, alancai98, am357 and lziq April 11, 2022 19:52
@jpschorr
Copy link
Contributor Author

cargo bench like produces:

     Running unittests (target/release/deps/bench_pattern_match-6ca80fffdf1f67c3)
WARNING: HTML report generation will become a non-default optional feature in Criterion.rs 0.4.0.
This feature is being moved to cargo-criterion (https://github.com/bheisler/cargo-criterion) and will be optional in a future version of Criterion.rs. To silence this warning, either switch to cargo-criterion or enable the 'html_reports' feature in your Cargo.toml.

like-simple-translate   time:   [221.61 ns 225.12 ns 229.42 ns]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe

like-simple-match       time:   [31.922 ns 32.227 ns 32.581 ns]
Found 11 outliers among 100 measurements (11.00%)
  7 (7.00%) high mild
  4 (4.00%) high severe

like-8k-translate       time:   [26.718 us 27.010 us 27.369 us]
Found 7 outliers among 100 measurements (7.00%)
  3 (3.00%) high mild
  4 (4.00%) high severe

like-8k-match           time:   [417.51 us 420.18 us 423.16 us]
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe

@jpschorr
Copy link
Contributor Author

I sketched this idea while thinking through alternatives to partiql/partiql-lang-kotlin#286 .

Whether or not it gets merged as is, I wanted to document the idea and its performance here.

@codecov
Copy link

codecov bot commented Apr 11, 2022

Codecov Report

Merging #98 (d1392fa) into main (61ae03c) will increase coverage by 0.32%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   94.96%   95.28%   +0.32%     
==========================================
  Files          12       13       +1     
  Lines        1052     1124      +72     
==========================================
+ Hits          999     1071      +72     
  Misses         53       53              
Impacted Files Coverage Δ
partiql-rewriter/src/lib.rs 100.00% <100.00%> (ø)
partiql-rewriter/src/pattern_match.rs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61ae03c...d1392fa. Read the comment docs.

@jpschorr jpschorr force-pushed the experimental-like-to-regex branch from 27cedf0 to d1392fa Compare April 21, 2022 17:35
@jpschorr jpschorr closed this Jan 10, 2023
@jpschorr jpschorr deleted the experimental-like-to-regex branch January 10, 2023 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant