You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to get this to work but the bigint option doesn't appear to work with the tbl dplyr function. Any int64 data types get returned as NAs
Here's an example. This doesn't work to return a 64 bit integer in the result:
> db <- dbConnect(bigrquery::bigquery(), project="hdcohdsicovid19", dataset="omop_covid19_kratos", bigint = "integer64")
> cohort_table_db<-tbl(db, sql("SELECT cast('123456789012345' as int64) as example"))
> cohort_table_db
Complete
Billed: 0 B
Downloading 1 rows in 1 pages.
# Source: SQL [?? x 1]
# Database: BigQueryConnection
example
<int>
1 NA
Warning message:
In as.integer.integer64(x) : NAs produced by integer overflow
but this does:
> db <- dbConnect(bigrquery::bigquery(), project="hdcohdsicovid19", dataset="omop_covid19_kratos", bigint = "integer64")
> cohort_table_db<- DBI::dbGetQuery(db, sql("SELECT cast('123456789012345' as int64) as example"))
Complete
Billed: 0 B
Downloading 1 rows in 1 pages.
> cohort_table_db
# A tibble: 1 x 1
example
<int64>
1 1.00e14
The bigint parameter seems like it gets ignored with the tbl function. Is there a better way to force 64 bit integers in to the result?
The text was updated successfully, but these errors were encountered:
+1 with this! i noticed the issue in the dbplyr::tbl implementation and raised this in a dbplyr issue: tidyverse/dbplyr#610
I've read back to prior related issues and realize this may be a bigger-picture issue with piecemeal bit64::integer64 support in general. Would it be useful to attempt a PR at this point to increase bit64::integer64 support in bigrquery OR to raise errors when this type of silent coercion happens? (Apologies if this is too repetitive asking here! Just trying to zero in on a solution.)
@CartWill changes in #440 should fix this too! Just tested locally. I wrote the PR focusing on collect() in a pipeline as per #439 but calling the tbl() object (and thus forcing eval) works as well.
cassws
added a commit
to cassws/bigrquery
that referenced
this issue
Apr 6, 2021
I've been trying to get this to work but the bigint option doesn't appear to work with the tbl dplyr function. Any int64 data types get returned as NAs
Here's an example. This doesn't work to return a 64 bit integer in the result:
but this does:
The bigint parameter seems like it gets ignored with the tbl function. Is there a better way to force 64 bit integers in to the result?
The text was updated successfully, but these errors were encountered: