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: Make nested joins work correctly from primary direction #1491

Merged

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #1490

Description

Issue found by Digital Gaia. Nesting joins would result in the parent span being propagated into the child/subType scanNode, this caused the scan node to scan the wrong prefix and return no inner child records.

@AndrewSisley AndrewSisley added bug Something isn't working area/query Related to the query component action/no-benchmark Skips the action that runs the benchmark. labels May 10, 2023
@AndrewSisley AndrewSisley requested a review from a team May 10, 2023 21:22
@AndrewSisley AndrewSisley self-assigned this May 10, 2023
@AndrewSisley AndrewSisley changed the title fix: Make nested joins do not work correctly from primary direction fix: Make nested joins work correctly from primary direction May 10, 2023
No changes to the test content
Removes the extra fields from the schema, and reorders stuff so that it is read in the order that it is used. Does also change the test itself, so that now it does actually test from the primary direction all the way through.
This results in the scan nodes of the inner most query (subType) trying to scan with the parent prefix - e.g. reading books from within the [publisher][doc1] prefix.
Some of these would fail before the fix was implemented.
Some of these would fail before the fix was implemented.
Copy link
Collaborator

@fredcarle fredcarle left a comment

Choose a reason for hiding this comment

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

🎆🤘

@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

Merging #1491 (61d8671) into develop (36261e1) will increase coverage by 0.12%.
The diff coverage is n/a.

❗ Current head 61d8671 differs from pull request most recent head f4e3016. Consider uploading reports for the commit f4e3016 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1491      +/-   ##
===========================================
+ Coverage    72.09%   72.22%   +0.12%     
===========================================
  Files          185      185              
  Lines        18241    18239       -2     
===========================================
+ Hits         13151    13173      +22     
+ Misses        4047     4028      -19     
+ Partials      1043     1038       -5     
Impacted Files Coverage Δ
planner/type_join.go 73.25% <ø> (+0.68%) ⬆️

... and 5 files with indirect coverage changes

@AndrewSisley AndrewSisley merged commit 54ed5b5 into sourcenetwork:develop May 10, 2023
8 checks passed
@AndrewSisley AndrewSisley deleted the 1469-connor-nested-query branch May 10, 2023 21:39
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
…etwork#1491)

## Relevant issue(s)

Resolves sourcenetwork#1490

## Description

Issue found by Digital Gaia. Nesting joins would result in the parent
span being propagated into the child/subType scanNode, this caused the
scan node to scan the wrong prefix and return no inner child records.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/query Related to the query component bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested joins do not work correctly from primary directions
2 participants