-
Notifications
You must be signed in to change notification settings - Fork 170
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
Inline select()
in *_join()
#875
Conversation
Conflicts: NAMESPACE R/lazy-join-query.R R/lazy-ops.R R/lazy-select-query.R R/lazy-set-op-query.R R/remote.R R/verb-joins.R man/sql_build.Rd
* remove default `by = NULL` as it does not work anyway * remove default `anti = FALSE` because anti comes before required argument `by`
@@ -7,6 +7,9 @@ lazy_join_query <- function(x, | |||
by, | |||
suffix = c(".x", ".y"), | |||
na_matches = c("never", "na"), | |||
group_vars = NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add_group_by()
adds the field group_vars
to any lazy_query
object. Similarly for order_vars
and frame
. So it makes sense to be able to explicitly set them when creating these objects.
@hadley Would be great if you could give feedback
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your logic makes sense to me, and I can see any obvious holes in it.
Is it worth including a test for some of the suffix cases? I'm not sure how much that overlaps with this code.
@@ -177,7 +177,8 @@ | |||
i Do you need to move arrange() later in the pipeline or use window_order() instead? | |||
Output | |||
<SQL> | |||
SELECT * FROM ( | |||
SELECT * | |||
FROM ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely like the FROM
on its own line.
It should not but rather be safe than sorry. So I added tests for suffix cases and named by. |
Closes #867.
left/right/full/inner_join()
Before
After
semi/anti_join()
Before
After
The
semi/anti_join()
could be improved further but I'm not sure it's worth it (mostly interesting when the join columns have different names and one usesrename()
instead of using a namedby
).