dbDataType function

Return the corresponding presto data type for the given R object

Return the corresponding presto data type for the given R object

## S4 method for signature 'PrestoDriver' dbDataType(dbObj, obj, ...)

Arguments

  • dbObj: A PrestoDriver object
  • obj: Any R object
  • ...: Extra optional parameters, not currently used

Returns

A character value corresponding to the Presto type for obj

Details

The default value for unknown classes is VARCHAR .

Examples

drv <- RPresto::Presto() dbDataType(drv, 1) dbDataType(drv, NULL) dbDataType(drv, as.POSIXct("2015-03-01 00:00:00", tz = "UTC")) dbDataType(drv, Sys.time()) dbDataType( drv, list( c("a" = 1L, "b" = 2L), c("a" = 3L, "b" = 4L) ) ) dbDataType( drv, list( c(as.Date("2015-03-01"), as.Date("2015-03-02")), c(as.Date("2016-03-01"), as.Date("2016-03-02")) ) ) dbDataType(drv, iris)
  • Maintainer: Jarod G.R. Meng
  • License: BSD_3_clause + file LICENSE
  • Last published: 2025-01-08