Skip to content

make odbcDataType() respect integer64 #698

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

Merged
merged 4 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# odbc (development version)

* The Microsoft SQL Server method for `odbcDataType()` will now return `"BIGINT"`
for integer64 objects rather than converting to `"FLOAT"` (@simonpcouch, #698).

* `databricks()` now works with manually supplied `pwd` and `uid` (#690).

* SQL Server: correctly enumerate schemas across databases in connections pane
Expand Down
1 change: 1 addition & 0 deletions R/driver-access.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NULL
time = "TIME",
binary = "BINARY",
integer = "INTEGER",
int64 = "INTEGER",
double = "DOUBLE",
character = varchar(obj),
logical = "BIT",
Expand Down
1 change: 1 addition & 0 deletions R/driver-bigquery.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ NULL
date = "DATE",
binary = "BYTES",
integer = "INT64",
int64 = "INT64",
double = "FLOAT64",
character = "STRING",
logical = "BOOL",
Expand Down
1 change: 1 addition & 0 deletions R/driver-hive.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ setMethod("dbQuoteString", c("Hive", "character"),
date = "DATE",
binary = "BINARY",
integer = "INT",
int64 = "INT",
double = "DOUBLE",
character = "STRING",
logical = "BOOLEAN",
Expand Down
1 change: 1 addition & 0 deletions R/driver-impala.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ NULL
datetime = "STRING",
date = "VARCHAR(10)",
integer = "INT",
int64 = "INT",
double = "DOUBLE",
character = "STRING",
logical = "BOOLEAN",
Expand Down
1 change: 1 addition & 0 deletions R/driver-mysql.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ NULL
time = "TIME",
binary = "BLOB",
integer = "INTEGER",
int64 = "INTEGER",
double = "DOUBLE",
character = "TEXT",
logical = "TINYINT",
Expand Down
1 change: 1 addition & 0 deletions R/driver-oracle.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ odbcDataType.Oracle <- function(con, obj, ...) {
datetime = "TIMESTAMP",
binary = "BLOB",
integer = "INTEGER",
int64 = "INTEGER",
double = "BINARY_DOUBLE",
character = "VARCHAR2(255)",
logical = "DECIMAL",
Expand Down
1 change: 1 addition & 0 deletions R/driver-postgres.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ NULL
time = "TIME",
binary = "bytea",
integer = "INTEGER",
int64 = "INTEGER",
double = "DOUBLE PRECISION",
character = "TEXT",
logical = "BOOLEAN",
Expand Down
1 change: 1 addition & 0 deletions R/driver-redshift.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
datetime = "TIMESTAMP",
date = "DATE",
integer = "INTEGER",
int64 = "INTEGER",
double = "DOUBLE PRECISION",
character = "VARCHAR(255)",
logical = "BOOLEAN",
Expand Down
1 change: 1 addition & 0 deletions R/driver-snowflake.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NULL
time = "TIME",
binary = "BINARY",
integer = "INTEGER",
int64 = "INTEGER",
double = "FLOAT",
character = "VARCHAR",
logical = "BOOLEAN",
Expand Down
1 change: 1 addition & 0 deletions R/driver-spark.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ setMethod("odbcConnectionSchemas", "Spark SQL",
date = "DATE",
binary = "BINARY",
integer = "INT",
int64 = "INT",
double = "DOUBLE",
character = "VARCHAR(255)",
logical = "BOOLEAN",
Expand Down
1 change: 1 addition & 0 deletions R/driver-sql-server.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ setMethod("sqlCreateTable", "Microsoft SQL Server",
time = "TIME",
binary = varbinary(obj),
integer = "INT",
int64 = "BIGINT",
double = "FLOAT",
character = varchar(obj),
logical = "BIT",
Expand Down
1 change: 1 addition & 0 deletions R/driver-sqlite.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ NULL
date = "NUMERIC",
binary = "BLOB",
integer = "INTEGER",
int64 = "INTEGER",
double = "REAL",
character = "TEXT",
logical = "NUMERIC",
Expand Down
1 change: 1 addition & 0 deletions R/driver-teradata.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ setMethod("odbcConnectionTables", c("Teradata", "character"),
time = "TIME",
binary = "BLOB",
integer = "INTEGER",
int64 = "INTEGER",
double = "FLOAT",
character = "VARCHAR(255)",
logical = "BYTEINT",
Expand Down
1 change: 1 addition & 0 deletions R/driver-vertica.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ NULL
datetime = "TIMESTAMP",
date = "DATE",
integer = "INTEGER",
int64 = "INTEGER",
double = "DOUBLE PRECISION",
character = "VARCHAR",
logical = "BOOLEAN",
Expand Down
4 changes: 4 additions & 0 deletions R/odbc-data-type.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ odbcDataType.default <- function(con, obj, ...) {
time = "TIME",
binary = "VARBINARY(255)",
integer = "INTEGER",
int64 = "INTEGER",
double = "DOUBLE PRECISION",
character = "VARCHAR(255)",
logical = "BIT", # only valid if DB supports Null fields
Expand Down Expand Up @@ -92,6 +93,9 @@ object_type <- function(obj) {
if (is(obj, "difftime")) {
return("time")
}
if (is(obj, "integer64")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should all really use inherits(), so I added to #673

return("int64")
}

return(typeof(obj))
}
Expand Down