Learn R Programming

RPresto (version 1.3.5)

src_presto: dplyr integration to connect to a Presto database.

Description

Allows you to connect to an existing database through a presto connection.

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.

Usage

src_presto(catalog = NULL, schema = NULL, user = NULL, host = NULL,
  port = NULL, source = NULL, session.timezone = NULL,
  parameters = NULL, ...)

tbl.src_presto(src, from, ...)

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

...

For src_presto other arguments passed on to the underlying database connector dbConnect. For tbl.src_presto, it is included for compatibility with the generic, but otherwise ignored.

src

A presto src created with src_presto.

from

Either a string giving the name of table in database, or sql described a derived table or compound join.

Examples

Run this code
# NOT RUN {
# To connect to a database
my_db <- src_presto(catalog = "hive", schema = "web", user = "onur",
  host = "localhost", port = 8888, session.timezone='Asia/Kathmandu')
# }
# NOT RUN {
First create a database connection with src_presto, then reference a tbl
within that database
my_tbl <- tbl(my_db, "my_table")
# }

Run the code above in your browser using DataLab