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

Fixing issue with multiple relations to same table #14131

Merged
merged 12 commits into from
Jul 10, 2024

Conversation

mike12345567
Copy link
Collaborator

Description

There was an issue with multiple relationships to the same table and SQS - as SQS uses a single junction table (no matter how many relationships) between the two tables. This is a bit more efficient than creating junction tables for every relationship and we have the information in the junction to decipher the relationships between their different columns (although we weren't doing this).

This created a problem when you had multiple relationships to the same table where all rows that were related would end up in every column, if you removed from one column it wouldn't understand what to do, as it might not be present in that column.

I've added a test case for internal tables for this, it doesn't impact external tables and is a relatively pointless test as relationships depend on foreign keys and specific configuration for external.

@mike12345567 mike12345567 self-assigned this Jul 9, 2024
@mike12345567 mike12345567 requested a review from a team as a code owner July 9, 2024 18:11
@mike12345567 mike12345567 requested review from samwho and removed request for a team July 9, 2024 18:11
@github-actions github-actions bot added size/m firestorm Data/Infra/Revenue Team labels Jul 9, 2024
])
})

isSqs &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these tests not applicable to all datasources?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Lucene can't do this and I've limited these test cases to internal because this doesn't have a lot of impact on external DBs, this is a problem which is specific to the internal implementation of relationships (and it's odd use of junction tables for efficiency)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd argue that while this problem affects SQS today, there's no reason it won't affect external datasources later. I'd strongly lean toward enabling this test in as many places as we can, to ensure parity is being maintained and future regressions don't affect places we weren't expecting.

@mike12345567 mike12345567 merged commit b06eb27 into master Jul 10, 2024
12 checks passed
@mike12345567 mike12345567 deleted the fix/correcting-multi-relationships branch July 10, 2024 11:09
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
firestorm Data/Infra/Revenue Team size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants