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

Fix REPLACE function with replace patterns #1755

Merged
merged 5 commits into from
Feb 5, 2025

Conversation

RobinTF
Copy link
Collaborator

@RobinTF RobinTF commented Feb 4, 2025

In the replace string of the REPLACE function, QLever now uses a dollar sign $ to dynamically fetch the replacement from the input. For example REPLACE("aabc", "(a+)b", "$1def$1") will now correctly result in "aadefaac".
This fix is implemented by manually converting the replacement string to the format the Google RE2 expects where the replacement format is not $n but \n.
Fixes #1664

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.01%. Comparing base (db6825c) to head (69b38ae).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1755      +/-   ##
==========================================
+ Coverage   89.98%   90.01%   +0.02%     
==========================================
  Files         395      395              
  Lines       37693    37779      +86     
  Branches     4241     4256      +15     
==========================================
+ Hits        33919    34005      +86     
  Misses       2478     2478              
  Partials     1296     1296              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left two and a half comments, that should be easy to address.

test/SparqlExpressionTest.cpp Outdated Show resolved Hide resolved
@sparql-conformance
Copy link

Conformance check passed ✅

Test Status Changes 📊

Number of Tests Previous Status Current Status
1 Failed Passed

Details: https://qlever.cs.uni-freiburg.de/sparql-conformance-ui?cur=69b38ae54f00f5ee92627b7dbf52aa2b759a18c6&prev=be240abc3bc9bfa731353d612c3db4c2187bba41

Copy link

sonarqubecloud bot commented Feb 4, 2025

@joka921 joka921 merged commit 1dbe2af into ad-freiburg:master Feb 5, 2025
24 checks passed
@RobinTF RobinTF deleted the fix-regex-substitutions branch February 5, 2025 07:42
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.

REGEX should use $1 instead of \1 etc.
2 participants