Skip to content

sql in in_catalog breaks with filter #1485

@carlganz

Description

@carlganz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions