diff --git a/DESCRIPTION b/DESCRIPTION index 220d5b8f..a8614611 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -67,6 +67,7 @@ Collate: 'driver-hive.R' 'driver-impala.R' 'driver-mysql.R' + 'driver-netezza.R' 'driver-oracle.R' 'driver-postgres.R' 'driver-redshift.R' diff --git a/NAMESPACE b/NAMESPACE index c81c0245..8bcfdaed 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -35,6 +35,7 @@ exportClasses(HDB) exportClasses(Hive) exportClasses(Impala) exportClasses(MySQL) +exportClasses(NetezzaSQL) exportClasses(OdbcConnection) exportClasses(OdbcDriver) exportClasses(OdbcResult) diff --git a/NEWS.md b/NEWS.md index 2d1733cc..7e1aeb5b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # odbc (development version) +* Netezza: Improved data type inference for character columns (#847). + * Added functions `odbcEditDrivers()`, `odbcEditSystemDSN()`, and `odbcEditUserDSN()` to provide a shorthand for `file.edit(odbcListConfig()[[i]])`. The helpers only support macOS and diff --git a/R/driver-netezza.R b/R/driver-netezza.R new file mode 100644 index 00000000..c293649a --- /dev/null +++ b/R/driver-netezza.R @@ -0,0 +1,16 @@ +#' @export +#' @rdname DBI-classes +setClass("NetezzaSQL", contains = "OdbcConnection") + +#' @export +#' @rdname odbcDataType +#' @usage NULL +setMethod("odbcDataType", "NetezzaSQL", + function(con, obj, ...) { + switch_type( + obj, + character = varchar(obj), + callNextMethod(con, obj, ...) + ) + } +) diff --git a/man/DBI-classes.Rd b/man/DBI-classes.Rd index 8e4fc2e7..b77495e7 100644 --- a/man/DBI-classes.Rd +++ b/man/DBI-classes.Rd @@ -1,9 +1,9 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/dbi.R, R/driver-access.R, R/driver-bigquery.R, % R/driver-db2.R, R/driver-hana.R, R/driver-hive.R, R/driver-impala.R, -% R/driver-mysql.R, R/driver-postgres.R, R/driver-redshift.R, -% R/driver-snowflake.R, R/driver-spark.R, R/driver-sqlite.R, -% R/driver-teradata.R, R/driver-vertica.R +% R/driver-mysql.R, R/driver-netezza.R, R/driver-postgres.R, +% R/driver-redshift.R, R/driver-snowflake.R, R/driver-spark.R, +% R/driver-sqlite.R, R/driver-teradata.R, R/driver-vertica.R \docType{class} \name{DBI-classes} \alias{DBI-classes} @@ -14,6 +14,7 @@ \alias{Hive-class} \alias{Impala-class} \alias{MySQL-class} +\alias{NetezzaSQL-class} \alias{PostgreSQL-class} \alias{Redshift-class} \alias{Snowflake-class} diff --git a/man/odbcDataType.Rd b/man/odbcDataType.Rd index 5c6331ee..8fbab99f 100644 --- a/man/odbcDataType.Rd +++ b/man/odbcDataType.Rd @@ -1,9 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/aaa-odbc-data-type.R, R/driver-access.R, % R/driver-bigquery.R, R/driver-hive.R, R/driver-impala.R, R/driver-mysql.R, -% R/driver-oracle.R, R/driver-postgres.R, R/driver-redshift.R, -% R/driver-snowflake.R, R/driver-spark.R, R/driver-sql-server.R, -% R/driver-sqlite.R, R/driver-teradata.R, R/driver-vertica.R +% R/driver-netezza.R, R/driver-oracle.R, R/driver-postgres.R, +% R/driver-redshift.R, R/driver-snowflake.R, R/driver-spark.R, +% R/driver-sql-server.R, R/driver-sqlite.R, R/driver-teradata.R, +% R/driver-vertica.R \name{odbcDataType} \alias{odbcDataType} \alias{odbcDataType,ANY-method} @@ -12,6 +13,7 @@ \alias{odbcDataType,Hive-method} \alias{odbcDataType,Impala-method} \alias{odbcDataType,MySQL-method} +\alias{odbcDataType,NetezzaSQL-method} \alias{odbcDataType,Oracle-method} \alias{odbcDataType,PostgreSQL-method} \alias{odbcDataType,Redshift-method}