tbl.src_presto | R Documentation |
Use src_presto
to connect to an existing database,
and tbl
to connect to tables within that database.
If you're unsure of the arguments to pass, please ask your database
administrator for the values of these variables.
Automatically create a Presto remote database source to wrap aroudn the
PrestoConnection
object via which DBI APIs can be called.
## S3 method for class 'src_presto'
tbl(src, from, ..., vars = NULL)
## S3 method for class 'PrestoConnection'
tbl(src, from, ...)
## S3 method for class 'src_presto'
copy_to(
dest,
df,
name = deparse(substitute(df)),
overwrite = FALSE,
...,
with = NULL
)
## S3 method for class 'PrestoConnection'
copy_to(
dest,
df,
name = deparse(substitute(df)),
overwrite = FALSE,
...,
with = NULL
)
src |
A |
from |
Either a string (giving a table name) or a literal
|
... |
Passed on to |
vars |
Provide column names as a character vector to avoid retrieving them from the database. |
dest |
remote data source |
df |
local data frame |
name |
name for new remote table. |
overwrite |
If |
with |
An optional WITH clause for the CREATE TABLE statement. |
## Not run:
# First create a database connection with src_presto, then reference a tbl
# within that database
my_db <- src_presto(
catalog = "memory",
schema = "default",
user = Sys.getenv("USER"),
host = "http://localhost",
port = 8080,
session.timezone = "Asia/Kathmandu"
)
my_tbl <- tbl(my_db, "my_table")
## End(Not run)
## Not run:
# First create a database connection, then reference a tbl within that
# database
my_con <- DBI::dbConnect(
catalog = "memory",
schema = "default",
user = Sys.getenv("USER"),
host = "http://localhost",
port = 8080,
session.timezone = "Asia/Kathmandu"
)
my_tbl <- tbl(my_con, "my_table")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.