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

Using qualified functions inside filter or arrange results in 'object not found' error for SQL #3696

Closed
janusvm opened this issue Jun 25, 2018 · 2 comments

Comments

@janusvm
Copy link

janusvm commented Jun 25, 2018

For an SQL backend, using desc() or between() inside an arrange or filter, respectively, returns an error if the functions are qualified.

library(dplyr, warn.conflicts = FALSE)
library(dbplyr, warn.conflicts = FALSE)
lf <- dbplyr::lazy_frame(x = 1, y = 1, 
                         src = dbplyr::simulate_dbi())

# Works
lf %>% 
  arrange(desc(y)) %>% 
  show_query()
#> <SQL> SELECT *
#> FROM "df"
#> ORDER BY "y" DESC
lf %>% 
  filter(between(y, 0, 1)) %>% 
  show_query()
#> <SQL> SELECT *
#> FROM "df"
#> WHERE ("y" BETWEEN 0.0 AND 1.0)

# Doesn't work
lf %>% 
  dplyr::arrange(dplyr::desc(y)) %>% 
  dplyr::show_query()
#> Error in dplyr::desc(y): object 'y' not found
lf %>% 
  dplyr::filter(dplyr::between(y, 0, 1)) %>% 
  dplyr::show_query()
#> Error in dplyr::between(y, 0, 1): object 'y' not found
@ghost
Copy link

ghost commented Jun 25, 2018

This issue was moved by batpigandme to tidyverse/dbplyr/issues/107.

@ghost ghost closed this as completed Jun 25, 2018
@lock
Copy link

lock bot commented Dec 22, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Dec 22, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant