dbDataType,AthenaDriver,ANY-method | R Documentation |
Returns a character string that describes the Athena SQL data type for the obj
object.
## S4 method for signature 'AthenaDriver,ANY'
dbDataType(dbObj, obj, ...)
## S4 method for signature 'AthenaDriver,list'
dbDataType(dbObj, obj, ...)
## S4 method for signature 'AthenaConnection,ANY'
dbDataType(dbObj, obj, ...)
## S4 method for signature 'AthenaConnection,data.frame'
dbDataType(dbObj, obj, ...)
dbObj |
A object inheriting from DBIDriver or DBIConnection |
obj |
An R object whose SQL type we want to determine. |
... |
Other arguments passed on to methods. |
dbDataType
returns the Athena type that correspond to the obj argument as an non-empty character string.
dbDataType
library(noctua)
dbDataType(athena(), 1:5)
dbDataType(athena(), 1)
dbDataType(athena(), TRUE)
dbDataType(athena(), Sys.Date())
dbDataType(athena(), Sys.time())
dbDataType(athena(), c("x", "abc"))
dbDataType(athena(), list(raw(10), raw(20)))
vapply(iris, function(x) dbDataType(noctua::athena(), x),
FUN.VALUE = character(1), USE.NAMES = TRUE
)
## Not run:
# Note:
# - Require AWS Account to run below example.
# - Different connection methods can be used please see `noctua::dbConnect` documnentation
library(DBI)
# Demo connection to Athena using profile name
con <- dbConnect(noctua::athena())
# Sending Queries to Athena
dbDataType(con, iris)
# Disconnect conenction
dbDisconnect(con)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.