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

19.5.3 Rolling joins - parties example #1610

Open
brtkl opened this issue Dec 17, 2023 · 1 comment · May be fixed by #1645
Open

19.5.3 Rolling joins - parties example #1610

brtkl opened this issue Dec 17, 2023 · 1 comment · May be fixed by #1645

Comments

@brtkl
Copy link

brtkl commented Dec 17, 2023

"And for each employee we want to find the first party date that comes after (or on) their birthday. We can express that with a rolling join:"

employees |> 
  left_join(parties, join_by(closest(birthday >= party)))

The sentence should rather be:
"And for each employee we want to find the last party date that comes before (or on) their birthday. We can express that with a rolling join:"

Alternatively, the code could be updated as follows

employees |> 
  left_join(parties, join_by(closest(birthday <= party)))

if we want parties after birthdays as mentioned in the original sentence

@florisvdh
Copy link
Contributor

I prepared PR #1645 to fix this issue.

Alternatively, the code could be updated as follows

employees |> 
  left_join(parties, join_by(closest(birthday <= party)))

if we want parties after birthdays as mentioned in the original sentence

True, but I haven't followed that since it would render the narrative and examples that come next obsolete.

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 a pull request may close this issue.

2 participants