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
MSSQL regression in boolean/bit coercion #318
Comments
|
I don't think this is related to R versions, but different versions of dbplyr. Here's a minimal reprex for the problem: library(dbplyr)
library(dplyr, warn.conflicts = FALSE)
lazy_frame(AGE_IN_YEARS = 10, con = simulate_mssql()) %>%
head(10) %>%
summarize(n90plus = sum(as.integer(AGE_IN_YEARS >= 90), na.rm = TRUE))
#> <SQL>
#> SELECT SUM(CAST(`AGE_IN_YEARS` >= 90.0 AS INT)) AS `n90plus`
#> FROM (SELECT TOP(10) *
#> FROM `df`) `dbplyr_001`Created on 2019-06-07 by the reprex package (v0.2.1.9000) |
|
@edgararuiz could you take a look? |
|
Looks like this is related to the removal of |
|
@ianmcook thanks! Do you use dbplyr with SQL server much? |
|
@hadley I have in the past, but I'm not these days |
On R Studio Pro Server, this MS SQL query worked fine in R 3.4.2 and R.3.5.0 but fails in R 3.5.1 and R 3.6.0. [Part of a much larger query originally.]
R 3.4.2 and 3.5.0 give this for
show_query(everything worked fine)sessionInfo: dbplyr_1.2.2 odbc_1.1.6 DBI_1.0.0
R 3.5.1 and R 3.6.0 show this for
show_queryand fails:sessionInfo: dbplyr_1.4.0 odbc_1.1.6 DBI_1.0.0
The failure message:
Both examples run on the same R Studio Pro server with the specified versions of R.
Both examples run with exact same database and same DB version: Microsoft SQL Server Version: 12.00.2000. The database is on Azure and I must specify the driver "ODBC Driver 17 for SQL Server".
The text was updated successfully, but these errors were encountered: