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

[r] bigint advertised in duckdb() and dbConnect(), but only the former is supported #6

Closed
2 tasks done
mtmorgan opened this issue Jul 18, 2023 · 3 comments
Closed
2 tasks done
Assignees

Comments

@mtmorgan
Copy link

mtmorgan commented Jul 18, 2023

What happens?

For BIGINT columns the help page ?duckdb suggests a field bigint = "integer64" can be present either in dbConnect(duckdb(bigint = "integer64")) or dbConnect(duckdb(), bigint = "integer64"), but this is only respected in the first case.

The help page code is at https://github.com/duckdb/duckdb/blob/f7f5cf30aa5dfbc900c98c57bef2d729f2bf1b56/tools/rpkg/man/duckdb.Rd#L31 and the implementation showing that bigint will often be ignored is at https://github.com/duckdb/duckdb/blob/f7f5cf30aa5dfbc900c98c57bef2d729f2bf1b56/tools/rpkg/R/dbConnect__duckdb_driver.R#L55-L58

To Reproduce

Install dependencies:

install.packages(c('duckdb', 'bit64'))
library(duckdb)

bigint used when in duckdb()...

con = dbConnect(duckdb(bigint = "integer64"))
dbWriteTable(con, "one", data.frame(i64 = bit64::as.integer64(1:5)))
dbGetQuery(con, "DESCRIBE one")
##   column_name column_type null  key default extra
## 1         i64      BIGINT  YES <NA>    <NA>    NA

...but not when in dbConnect()

con = dbConnect(duckdb(), bigint = "integer64")
dbWriteTable(con, "one", data.frame(i64 = bit64::as.integer64(1:5)))
dbGetQuery(con, "DESCRIBE one")
##   column_name column_type null  key default extra
## 1         i64      DOUBLE  YES <NA>    <NA>    NA

OS:

aarch64-apple-darwin21.6.0

DuckDB Version:

0.8.1.1

DuckDB Client:

R

Full Name:

Martin Morgan

Affiliation:

Roswell Park Comprehensive Cancer Center

Have you tried this on the latest master branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree
@szarnyasg szarnyasg transferred this issue from duckdb/duckdb Sep 13, 2023
@krlmlr
Copy link
Collaborator

krlmlr commented Dec 2, 2023

Thanks, confirmed:

library(duckdb)
#> Loading required package: DBI
con <- dbConnect(duckdb(), bigint = "integer64")
dbWriteTable(con, "one", data.frame(i64 = bit64::as.integer64(1:5)))
dbGetQuery(con, "DESCRIBE one")
#>   column_name column_type null  key default extra
#> 1         i64      DOUBLE  YES <NA>    <NA>    NA

Created on 2023-12-02 with reprex v2.0.2

@krlmlr
Copy link
Collaborator

krlmlr commented Apr 24, 2024

Is this still an issue with v0.10.1, on CRAN now?

@mtmorgan
Copy link
Author

The behavior reported above does not occur with duckdb 0.10.1 on aarch64-apple-darwin20.

@krlmlr krlmlr closed this as completed Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants