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

sql in in_catalog breaks with filter #1485

Open
carlganz opened this issue Mar 25, 2024 · 1 comment
Open

sql in in_catalog breaks with filter #1485

carlganz opened this issue Mar 25, 2024 · 1 comment

Comments

@carlganz
Copy link

I am having trouble generating reproducible example because I don't know how to mock catalogs and table valued functions but effectively issue is:

library(dbplyr)
library(dplyr)

con <- simulate_odbc()

# this works fine, we have select * with no prefix; datawarehouse and dbo will have quotes in query but MyTableValuedFunction won't
tbl(con, in_catalog("Datawarehouse", "DBO", sql("MyTableValuedFunction(Param1, Param2)"))) %>%
  show_query

# now that I have filter it will try to prefix * like "MyTableValuedFunction(Param1, Param2)".*  with quotes and it won't work it needs an alias
tbl(con, in_catalog("Datawarehouse", "DBO", sql("MyTableValuedFunction(Param1, Param2)"))) %>%
  filter(getdate() > 1) %>%
  show_query

This worked before 2.4.0 so it appears fixes in 2.5.0 haven't covered everything.

@mgirlich
Copy link
Collaborator

Hmm, we should probably force an alias when the table name is sql. I'll have a look.

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