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

TestQueryWithIndexOnOneToTwoRelation_IfFilterOnIndexedRelation_ShouldFilter is incorrect #2574

Closed
AndrewSisley opened this issue May 1, 2024 · 2 comments · Fixed by #2579
Assignees
Labels
area/query Related to the query component bug Something isn't working priority/high
Milestone

Comments

@AndrewSisley
Copy link
Contributor

AndrewSisley commented May 1, 2024

It looks at first glance to be a good test, but it actually shows a one-many being yielded as a one-one (devices in the second request is a one-many and should be of type []map[string]any).

Removing the index from the Device.model field results in the correct result.

Possibly related to #2577

@AndrewSisley AndrewSisley added bug Something isn't working area/query Related to the query component priority/high labels May 1, 2024
AndrewSisley added a commit that referenced this issue May 2, 2024
## Relevant issue(s)

Resolves #2572

## Description

Handles compound filters targeting related indexed fields, and one-many
joins from the many side.

The invertableJoin issue may be affecting non indexed joins.

There is another issue in this space not solved by this PR:
#2574
@AndrewSisley AndrewSisley self-assigned this May 2, 2024
@AndrewSisley AndrewSisley added this to the DefraDB v0.11 milestone May 2, 2024
AndrewSisley added a commit that referenced this issue May 3, 2024
## Relevant issue(s)

Resolves #2574

## Description

Return correct results from one-many joins filtered on an indexed field
on the many side.

The invertibleTypeJoin doesn't support the inversion of one-many joins
and was converting them into one-one joins.

This means that the index is no longer used if targeting the many side:
#2578 (this support can
be added after the release).
@islamaliev
Copy link
Contributor

@AndrewSisley did you by any chance create a task to enable handling one-many by inverted join?

@AndrewSisley
Copy link
Contributor Author

@AndrewSisley did you by any chance create a task to enable handling one-many by inverted join?

Yes, the ticket is here: #2578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/query Related to the query component bug Something isn't working priority/high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants