dbplyr translation to SQL

Dewey Dunnington (http://twitter.com/paleolimbot) published a really cool way to see how dbplyr translates dplyr into SQL: https://apps.fishandwhistle.net/archives/1503 . Unfortunately it fails with native postgres although it seems to work fine with odbc_postgres:

## # A tibble: 13 x 2
##    variant             n
##    <chr>           <int>
##  1 dbi               163
##  2 hive              180
##  3 impala            184
##  4 mssql             192
##  5 mysql             113
##  6 odbc              163
##  7 odbc_access       186
##  8 odbc_postgresql   184
##  9 oracle            180
## 10 postgres            1
## 11 sqlite            120
## 12 teradata          190
## 13 test              163

Here's the code I lifted from his site: https://github.com/smithjd/sql-pet/blob/master/book-src/dbplyr-sql-function-translation.R

Here is my attempt to dig into this problem. I would like to list how dplyr generates SQL for each translated function. I can just skip "postgres" but using "odbc_postgresql" just doesn't seem right (since I can't get ODBC to work on my machine and so I never interact with postgres that way!)...

Hi, when you mention postgres are you referring to a connection via the RPostgres package (https://github.com/r-dbi/RPostgres)? If so, can you please open an Issue in that package along with a reprex? Thanks!

1 Like

Done! (Thanks for the suggestion...)

This problem has disappeared. The code now works OK.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.