-
Notifications
You must be signed in to change notification settings - Fork 175
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
Filter by a column in another table #1476
Comments
Would the following work (translating
As you mentioned, using table <- dbplyr::lazy_frame(i = 1, con = dbplyr::simulate_dbi())
table$id
#> Error in `table$id`:
#> ! The `$` method of <tbl_lazy> is for internal use only.
#> ℹ Use `dplyr::pull()` to get the values in a column. Created on 2024-03-15 with reprex v2.1.0 |
Yeah, a semi join is what you want here. Thanks for the explanation @fh-mthomson! |
Hi @fh-mthomson , Thanks for your great explanation! I'm just curious about the reason that the |
The See more technical detail in #1056
|
To add to @fh-mthomson's explanation, I don't think there's an obvious way to translate |
This is an amazing package that helps me a lot in my work! I'm not sure if this is just a limitation in my backend database(I'm using Oracle SQL) or a feature that hasn't been developed. Suppose I have a database with two tables
A
andB
where both tables have anid
column, what I want to do is to filter the rows in tableA
where the id is presented inB
. Here is a minimum example in dplyr:This, however, cannot be easily converted to
dbplyr
if bothA
andB
are tables in a database. Subsetting the objectB
by column name will give aNULL
value(e.g.B$id = NULL
) and therefore lead to an error. As a workaround, I have to preprocess the tableB
to create distinctid
s, then perform an inner join. It is still fine, but not that elegant. I wonder if there is any better way to do the filter.The text was updated successfully, but these errors were encountered: