Description Usage Arguments Details Value Examples
Return the corresponding presto data type for the given R object
1 2 | ## S4 method for signature 'PrestoDriver'
dbDataType(dbObj, obj, ...)
|
dbObj |
A |
obj |
Any R object |
... |
Extra optional parameters, not currently used |
The default value for unknown classes is ‘VARCHAR’.
‘ARRAY’s and ‘MAP’s are supported with some caveats. Unnamed lists will be treated as ‘ARRAY’s and named lists will be a ‘MAP’. All items are expected to be of the same corresponding Presto type, otherwise the default ‘VARCHAR’ value is returned. The key type for ‘MAP’s is always ‘VARCHAR’. The ‘value’ type for empty lists is always a ‘VARCHAR’.
A character
value corresponding to the Presto type for
obj
1 2 3 4 5 6 7 8 9 | drv <- RPresto::Presto()
dbDataType(drv, list())
dbDataType(drv, 1)
dbDataType(drv, NULL)
dbDataType(drv, list(list(list(a=Sys.Date()))))
dbDataType(drv, as.POSIXct('2015-03-01 00:00:00', tz='UTC'))
dbDataType(drv, Sys.time())
# Data types for ARRAY or MAP values can be tricky
all.equal('VARCHAR', dbDataType(drv, list(1, 2, 3L)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.