Learn R Programming

RPresto (version 1.2.1)

Presto: Connect to a Presto database

Description

Connect to a Presto database

Usage

Presto(...)

# S4 method for PrestoDriver dbConnect(drv, catalog, schema, user, host = "localhost", port = 8080, session.timezone = "UTC", parameters = list(), ...)

# S4 method for PrestoConnection dbDisconnect(conn)

Arguments

...

currently ignored

drv

A driver object generated by Presto

catalog

The catalog to be used

schema

The schema to be used

user

The current user

host

The presto host to connect to

port

Port to use for the connection

session.timezone

Time zone to use for the connection. Presto returns timestamps without time zones with respect to this value. The time arithmetic (e.g. adding hours) will also be done in the given time zone. See the session.timezone tests for examples.

parameters

A list of extra parameters to be passed in the ‘X-Presto-Session’ header

conn

A '>PrestoConnection object

Value

[Presto] A '>PrestoDriver object

[dbConnect] A '>PrestoConnection object

[dbDisconnect] A logical value indicating success

Examples

Run this code
# NOT RUN {
  conn <- dbConnect(Presto(), catalog = 'hive', schema = 'default',
                    user = 'onur', host = 'localhost', port = 8080,
                    session.timezone='US/Eastern')
  dbListTables(conn, '%_iris')
  dbDisconnect(conn)
# }

Run the code above in your browser using DataLab