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 a bug in the cache key of DISTINCT #1403

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

joka921
Copy link
Member

@joka921 joka921 commented Jul 16, 2024

The cache key of a DISTINCT operation previously did not change when the subtree stayed the same, but the variables on which the DISTINCT was performed changed. For example, when first executing SELECT DISTINCT ?x ?y WHERE { ?x wdt:P30 ?y } and then SELECT DISTINCT ?x WHERE { ?x wdt:P30 ? }, the result for the second query would be mistakenly taken from the cache, although those queries have different results. This is now fixed by adding the column indices of the variables to the cache key.

Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

Project coverage is 89.14%. Comparing base (6a6a4b8) to head (abc3653).

Files Patch % Lines
src/engine/Distinct.h 62.50% 3 Missing ⚠️
src/engine/Distinct.cpp 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1403      +/-   ##
==========================================
- Coverage   89.14%   89.14%   -0.01%     
==========================================
  Files         332      332              
  Lines       29498    29497       -1     
  Branches     3291     3291              
==========================================
- Hits        26296    26295       -1     
  Misses       2050     2050              
  Partials     1152     1152              

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

Copy link

Copy link
Member

@hannahbast hannahbast left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the fix!

@hannahbast hannahbast changed the title Bugfix for the cache key of Distinct Fix a bug in the cache key of DISTINCT Jul 18, 2024
@hannahbast hannahbast merged commit 49e4134 into ad-freiburg:master Jul 18, 2024
19 of 20 checks passed
@joka921 joka921 deleted the distinct-cache-key-bug branch December 18, 2024 09:47
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.

2 participants