dbDataType: Return the corresponding presto data type for the given R...

dbDataType,PrestoDriver-methodR Documentation

Return the corresponding presto data type for the given R object

Description

Return the corresponding presto data type for the given R object

Usage

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

Arguments

dbObj

A PrestoDriver object

obj

Any R object

...

Extra optional parameters, not currently used

Details

The default value for unknown classes is ‘VARCHAR’.

Value

A character value corresponding to the Presto type for obj

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)

RPresto documentation built on Nov. 2, 2023, 5:58 p.m.