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

An attribute-based version of the relationship argument #7654

Closed
krlmlr opened this issue Feb 7, 2025 · 2 comments
Closed

An attribute-based version of the relationship argument #7654

krlmlr opened this issue Feb 7, 2025 · 2 comments

Comments

@krlmlr
Copy link
Member

krlmlr commented Feb 7, 2025

What would the following syntax feel like?

inner_join(one_from(lhs), one_from(rhs)) # relationship = "one-to-one"
left_join(one_from(lhs), rhs) # relationship = "one-to-many"
full_join(lhs, one_from(rhs)) # relationship = "many-to-one"
inner_join(many_from(lhs), many_from(rhs)) # relationship = "many-to-many"

The functions would merely add a class that dplyr/duckplyr could react upon, each in their own unique way.

We could also explore extending the powerjoin package, CC @moodymudskipper.

@DavisVaughan
Copy link
Member

Can you help me understand why duckplyr can't use the current relationship argument directly?

@krlmlr krlmlr changed the title A duckplyr-compatible version of the relationship argument An attribute-based version of the relationship argument Feb 8, 2025
@krlmlr
Copy link
Member Author

krlmlr commented Feb 8, 2025

The default is horrible from a performance perspective. This is "just" an incompatibility, I have code that implements the checks (but not in the main branch yet).

I was confused, duckplyr can deal with this either way. I have written this also with dm in mind that could provide the relationship information too. This will be most useful if the default join generics/methods query this information and translate it. No action needed, I'm open to discussing this if this sparks interest.

@krlmlr krlmlr closed this as completed Feb 8, 2025
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

No branches or pull requests

2 participants