Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Conversation

daniel-martinez-maqueda-sap
Copy link
Contributor

Which issue does this PR close?

Closes #702

Rationale for this change

It is explained in the Issues linked above.

What changes are included in this PR?

Added a new function that replaces the like wildcards '%' and '_' for the regex counterparts before executing them. It also takes into account that the wildcards can be escaped, in that case, it does remove the escape characters and leaves the wildcards so that they are matched against the raw character.

This is implemented iterating over all the characters of the pattern to figure out when it needs to be transformed or not.

Are there any user-facing changes?

N/A

Added a new function that replaces the like wildcards '%' and '_' for
the regex counterparts before executing them. It also takes into account
that the wildcards can be escaped, in that case, it does remove the
escape characters and leaves the wildcards so that they are matched
against the raw character.

This is implemented iterating over all the characters of the pattern to
figure out when it needs to be transformed or not.
@jorgecarleitao jorgecarleitao added the bug Something isn't working label Aug 3, 2022
@codecov
Copy link

codecov bot commented Aug 3, 2022

Codecov Report

Merging #1204 (65c9a1a) into main (3f3febf) will decrease coverage by 0.09%.
The diff coverage is 81.81%.

@@            Coverage Diff             @@
##             main    #1204      +/-   ##
==========================================
- Coverage   83.44%   83.34%   -0.10%     
==========================================
  Files         366      366              
  Lines       36697    36793      +96     
==========================================
+ Hits        30621    30666      +45     
- Misses       6076     6127      +51     
Impacted Files Coverage Δ
src/compute/like.rs 61.08% <81.81%> (+19.79%) ⬆️
src/array/fixed_size_binary/mutable.rs 85.20% <0.00%> (-4.80%) ⬇️
src/io/parquet/read/statistics/struct_.rs 57.50% <0.00%> (-4.67%) ⬇️
src/io/parquet/read/statistics/map.rs 50.00% <0.00%> (-4.06%) ⬇️
src/array/list/mutable.rs 72.15% <0.00%> (-3.89%) ⬇️
src/io/parquet/read/statistics/dictionary.rs 44.73% <0.00%> (-3.84%) ⬇️
src/array/fixed_size_list/mutable.rs 49.21% <0.00%> (-3.73%) ⬇️
src/io/parquet/read/statistics/list.rs 59.61% <0.00%> (-3.65%) ⬇️
src/array/dictionary/mutable.rs 79.57% <0.00%> (-3.52%) ⬇️
src/io/avro/read/nested.rs 61.79% <0.00%> (-2.74%) ⬇️
... and 8 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jorgecarleitao jorgecarleitao merged commit 4df28c9 into jorgecarleitao:main Aug 3, 2022
@jorgecarleitao
Copy link
Owner

Thanks a lot @daniel-martinez-maqueda-sap 🙇

jorgecarleitao pushed a commit that referenced this pull request Aug 4, 2022
@jorgecarleitao
Copy link
Owner

Released as part of 0.13.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix LIKE escape issues
2 participants