Skip to content

DBI-based adapter for Presto for the statistical programming language R.

License

Notifications You must be signed in to change notification settings

vecchiocarmelo/RPresto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RPresto

RPresto is a DBI-based adapter for the open source distributed SQL query engine Presto for running interactive analytic queries.

Installation

RPresto is not yet released on CRAN. You can install the github version via

devtools::install_github('prestodb/RPresto')

Examples

The standard DBI approach works with RPresto:

con <- dbConnect(
  RPresto::Presto(),
  host='http://localhost',
  port=7777,
  user=Sys.getenv('USER'),
  schema='<schema>',
  catalog='<catalog>'
)

res <- dbSendQuery(con, 'SELECT 1')
# n != -1 for dbFetch is not supported
data <- dbFetch(res)

# For iris.sql()
source(system.file('tests', 'testthat', 'utilities.R', package='RPresto'))

iris <- dbGetQuery(con, paste("SELECT * FROM", iris.sql()))

dbDisconnect(con)

How RPresto works

Presto exposes its interface via a REST based API1. We utilize the httr package to make the API calls and use jsonlite to reshape the data into a data.frame. Note that as of now, only read operations are supported.

License

RPresto is BSD-licensed. We also provide an additional patent grant.

[1] See https://gist.github.com/electrum/7710544 for an unofficial description of the API.

About

DBI-based adapter for Presto for the statistical programming language R.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • R 95.7%
  • C++ 4.3%