Allows you to connect to an existing database through a presto connection.
Usage
src_presto(
catalog = NULL,
schema = NULL,
user = NULL,
host = NULL,
port = NULL,
source = NULL,
session.timezone = NULL,
parameters = NULL,
bigint = c("integer", "integer64", "numeric", "character"),
con = NULL,
...
)
Arguments
- catalog
Catalog to use in the connection
- schema
Schema to use in the connection
- user
User name to use in the connection
- host
Host name to connect to the database
- port
Port number to use with the host name
- source
Source to specify for the connection
- session.timezone
Time zone for the connection
- parameters
Additional parameters to pass to the connection
- bigint
The R type that Presto's 64-bit integer (
BIGINT
) types should be translated to. The default is"integer"
, which returns R'sinteger
type, but results inNA
for values above/below +/-2147483647."integer64"
returns a bit64::integer64, which allows the full range of 64 bit integers."numeric"
coerces into R'sdouble
type but might result in precision loss. Lastly,"character"
casts into R'scharacter
type.- con
An object that inherits from PrestoConnection, typically generated by DBI::dbConnect. When a valid connection object is supplied, Other arguments are ignored.
- ...
For
src_presto
other arguments passed on to the underlying database connectordbConnect
. Fortbl.src_presto
, it is included for compatibility with the generic, but otherwise ignored.
Examples
if (FALSE) {
# To connect to a database
my_db <- src_presto(
catalog = "memory",
schema = "default",
user = Sys.getenv("USER"),
host = "http://localhost",
port = 8080,
session.timezone = "Asia/Kathmandu"
)
# Use a PrestoConnection
my_con <- DBI::dbConnect(
catalog = "memory",
schema = "default",
user = Sys.getenv("USER"),
host = "http://localhost",
port = 8080,
session.timezone = "Asia/Kathmandu"
)
my_db2 <- src_presto(con = my_con)
}