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

Fail to create tbl using arbitrary sql #218

Closed
hadley opened this issue Apr 3, 2018 · 3 comments

Comments

@hadley
Copy link
Member

commented Apr 3, 2018

library(dplyr, warn.conflicts = FALSE)
library(bigrquery)

con_us <- DBI::dbConnect(
  dbi_driver(),
  project = "bigquery-public-data",
  dataset = "utility_us",
  billing = "profound-ranger-99202"
)

x <- tbl(con_us, sql("SELECT * FROM utility_eu.country_code_iso"))

(Part of #101)

@hadley hadley changed the title Cannot have backend using arbitrary sql Fail to create tbl using arbitrary sql Apr 3, 2018

@czeildi

This comment has been minimized.

Copy link

commented Apr 8, 2018

I am not sure if you are already aware of this but the issue now is that db_query_fields.BigQueryConnection in dplyr.r calls get_table with sql as 3rd parameter while get_table expects a table name.

@hadley

This comment has been minimized.

Copy link
Member Author

commented Apr 12, 2018

I think fixing this requires a change to dbplyr. Currently tbl() calls dplyr:::tbl.DBIConnection which calls dbplyr::src_dbi(). src_dbi() is not currently generic, so there's no way for bigrquery to insert correct behaviour.

@hadley hadley closed this in b23c220 Apr 12, 2018

@hadley

This comment has been minimized.

Copy link
Member Author

commented Apr 12, 2018

@czeildi nope, I was wrong and your analysis was correct 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.