From 4597f96301b537784e37a941fc42a1b3cd23d6ed Mon Sep 17 00:00:00 2001 From: boB Rudis Date: Mon, 19 Mar 2018 18:09:17 -0400 Subject: [PATCH] beta-update --- .Rbuildignore | 1 + .bash_profile | 1 + CONDUCT.md | 25 ++++ DESCRIPTION | 15 ++- NAMESPACE | 5 + NEWS.md | 9 ++ R/jdbc.r | 143 +++++++++++++++++---- R/metis-package.R | 2 + README.Rmd | 66 +++++++--- README.md | 124 ++++++++++++------ man/dbConnect-AthenaDriver-method.Rd | 21 ++- ...xistsTable-AthenaConnection-character-method.Rd | 21 +++ ...dbGetQuery-AthenaConnection-character-method.Rd | 10 +- ...ListFields-AthenaConnection-character-method.Rd | 21 +++ man/dbListTables-AthenaConnection-method.Rd | 21 +++ ...bReadTable-AthenaConnection-character-method.Rd | 21 +++ ...bSendQuery-AthenaConnection-character-method.Rd | 19 +++ man/dbSendQuery-AthenaDriver-ANY-method.Rd | 12 -- man/metis.Rd | 1 + 19 files changed, 439 insertions(+), 99 deletions(-) create mode 100644 .bash_profile create mode 100644 CONDUCT.md create mode 100644 man/dbExistsTable-AthenaConnection-character-method.Rd create mode 100644 man/dbListFields-AthenaConnection-character-method.Rd create mode 100644 man/dbListTables-AthenaConnection-method.Rd create mode 100644 man/dbReadTable-AthenaConnection-character-method.Rd create mode 100644 man/dbSendQuery-AthenaConnection-character-method.Rd delete mode 100644 man/dbSendQuery-AthenaDriver-ANY-method.Rd diff --git a/.Rbuildignore b/.Rbuildignore index 1c60b19..edf18c6 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ ^\.codecov\.yml$ ^README_files$ ^doc$ +^CONDUCT\.md$ diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..764209c --- /dev/null +++ b/.bash_profile @@ -0,0 +1 @@ +export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/RHome diff --git a/CONDUCT.md b/CONDUCT.md new file mode 100644 index 0000000..52a673e --- /dev/null +++ b/CONDUCT.md @@ -0,0 +1,25 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free experience for +everyone, regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. + +Examples of unacceptable behavior by participants include the use of sexual language or +imagery, derogatory comments or personal attacks, trolling, public or private harassment, +insults, or other unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, +commits, code, wiki edits, issues, and other contributions that are not aligned to this +Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed +from the project team. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by +opening an issue or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the Contributor Covenant +(http:contributor-covenant.org), version 1.0.0, available at +http://contributor-covenant.org/version/1/0/0/ diff --git a/DESCRIPTION b/DESCRIPTION index 064fbb0..a1de4c7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,11 +1,16 @@ Package: metis Type: Package Title: Helpers for Accessing and Querying Amazon Athena -Version: 0.1.0 -Date: 2017-05-16 -Author: Bob Rudis (bob@rud.is) +Version: 0.2.0 +Date: 2018-03-19 +Authors@R: c( + person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"), + comment = c(ORCID = "0000-0001-5670-2640")) + ) Maintainer: Bob Rudis -Description: Helpers for Accessing and Querying Amazon Athena. Including a lightweight RJDBC shim. +Encoding: UTF-8 +Description: Helpers for Accessing and Querying Amazon Athena. Including a + lightweight RJDBC shim. URL: https://github.com/hrbrmstr/metis BugReports: https://github.com/hrbrmstr/metis/issues License: AGPL @@ -19,4 +24,4 @@ Imports: DBI, dplyr, aws.signature -RoxygenNote: 6.0.1 +RoxygenNote: 6.0.1.9000 diff --git a/NAMESPACE b/NAMESPACE index 99f6331..be6bc8d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,10 +8,15 @@ exportClasses(AthenaConnection) exportClasses(AthenaDriver) exportClasses(AthenaResult) exportMethods(dbConnect) +exportMethods(dbExistsTable) exportMethods(dbGetQuery) +exportMethods(dbListFields) +exportMethods(dbListTables) +exportMethods(dbReadTable) exportMethods(dbSendQuery) import(DBI) import(RJDBC) import(dplyr) importFrom(aws.signature,read_credentials) importFrom(aws.signature,use_credentials) +importFrom(readr,type_convert) diff --git a/NEWS.md b/NEWS.md index c27aefc..31a459f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,12 @@ +0.2.0 +========= + +- Updated authentication provider to be `com.amazonaws.athena.jdbc.shaded.com.amazonaws.auth.DefaultAWSCredentialsProviderChain` (via @dabdine) +- Now supports additional DBI/RJDBC methods including: `dbExistsTable()`, + `dbListFields()`, `dbListTables()`, `dbReadTable()` +- More documentation +- Added code of conduct + 0.1.0 ========= diff --git a/R/jdbc.r b/R/jdbc.r index 6ecce83..a46a360 100644 --- a/R/jdbc.r +++ b/R/jdbc.r @@ -1,20 +1,38 @@ #' AthenaJDBC #' #' @export -setClass("AthenaDriver", representation("JDBCDriver", identifier.quote="character", jdrv="jobjRef")) +setClass( + + "AthenaDriver", + representation("JDBCDriver", identifier.quote="character", jdrv="jobjRef") + +) #' AthenaJDBC #' #' @export Athena <- function(identifier.quote='`') { + drv <- JDBC(driverClass="com.amazonaws.athena.jdbc.AthenaDriver", system.file("AthenaJDBC41-1.1.0.jar", package="metis"), identifier.quote=identifier.quote) + return(as(drv, "AthenaDriver")) + } #' AthenaJDBC #' +#' @param provider JDBC auth provider (ideally leave default) +#' @param region AWS region the Athena tables are in +#' @param s3_staging_dir A write-able bucket on S3 that you have permissions for +#' @param schema_name LOL if only this actually worked with Amazon's hacked Presto driver +#' @param max_error_retries,connection_timeout,socket_timeout,retry_base_delay,retry_max_backoff_time +#' technical connection info that you should only muck with if you know what you're doing. +#' @param log_path,log_level The Athena JDBC driver can (shockingly) provide a decent bit +#' of data in logs. Set this to a temporary directory or somethign log4j can use. +#' @param ... unused +#' @references #' @export setMethod( @@ -35,9 +53,9 @@ setMethod( log_level, ...) { - conn_string = sprintf('jdbc:awsathena://athena.%s.amazonaws.com:443/%s', region, schema_name) - - # if (!is.null(provider)) { + conn_string = sprintf( + 'jdbc:awsathena://athena.%s.amazonaws.com:443/%s', region, schema_name + ) jc <- callNextMethod(drv, conn_string, s3_staging_dir = s3_staging_dir, @@ -52,24 +70,6 @@ setMethod( aws_credentials_provider_class = provider, ...) - # } else { - # - # jc <- callNextMethod(drv, conn_string, - # schema_name = schema_name, - # max_error_retries = max_error_retries, - # connection_timeout = connection_timeout, - # socket_timeout = socket_timeout, - # retry_base_delay = retry_base_delay, - # retry_max_backoff_time = retry_max_backoff_time, - # s3_staging_dir = s3_staging_dir, - # schema_name = schema_name, - # log_path = log_path, - # log_level = log_level, - # user = Sys.getenv("AWS_ACCESS_KEY_ID"), - # password = Sys.getenv("AWS_SECRET_ACCESS_KEY")) - # - # } - return(as(jc, "AthenaConnection")) } @@ -88,11 +88,14 @@ setClass("AthenaResult", contains = "JDBCResult") #' AthenaJDBC #' +#' @param conn Athena connection +#' @param statement SQL statement +#' @param ... unused #' @export setMethod( "dbSendQuery", - "AthenaDriver", + signature(conn="AthenaConnection", statement="character"), def = function(conn, statement, ...) { return(as(callNextMethod(), "AthenaResult")) @@ -102,16 +105,106 @@ setMethod( #' AthenaJDBC #' +#' @param conn Athena connection +#' @param statement SQL statement +#' @param ... unused #' @export setMethod( "dbGetQuery", signature(conn="AthenaConnection", statement="character"), - def = function(conn, statement, ...) { + def = function(conn, statement, type_convert=FALSE, ...) { r <- dbSendQuery(conn, statement, ...) on.exit(.jcall(r@stat, "V", "close")) - dplyr::tbl_df(fetch(r, -1, block=1000)) + res <- dplyr::tbl_df(fetch(r, -1, block=1000)) + if (type_convert) res <- readr::type_convert(res) + res + } + +) +#' AthenaJDBC +#' +#' @param conn Athena connection +#' @param pattern table name pattern +#' @param schema Athena schema name +#' @param ... unused +#' @export +setMethod( + + "dbListTables", + signature(conn="AthenaConnection"), + + def = function(conn, pattern='*', schema, ...) { + + if (missing(pattern)) { + dbGetQuery( + conn, sprintf("SHOW TABLES IN %s", schema) + ) -> x + } else { + dbGetQuery( + conn, sprintf("SHOW TABLES IN %s %s", schema, dbQuoteString(conn, pattern)) + ) -> x + } + + x$tab_name + } + +) + +#' AthenaJDBC +#' +#' @param conn Athena connection +#' @param name table name +#' @param schema Athena schema name +#' @param ... unused +#' @export +setMethod( + + "dbExistsTable", + signature(conn="AthenaConnection", name="character"), + + def = function(conn, name, schema, ...) { + length(dbListTables(conn, schema=schema, pattern=name)) > 0 + } + +) + +#' AthenaJDBC +#' +#' @param conn Athena connection +#' @param name table name +#' @param schema Athena schema name +#' @param ... unused +#' @export +setMethod( + + "dbListFields", + signature(conn="AthenaConnection", name="character"), + + def = function(conn, name, schema, ...) { + query <- sprintf("SELECT * FROM %s.%s LIMIT 1", schema, name) + res <- dbGetQuery(conn, query) + colnames(res) + } + +) + +#' AthenaJDBC +#' +#' @param conn Athena connection +#' @param name table name +#' @param schema Athena schema name +#' @param ... unused +#' @export +setMethod( + + "dbReadTable", + signature(conn="AthenaConnection", name="character"), + + def = function(conn, name, schema, ...) { + query <- sprintf("SELECT * FROM %s.%s LIMIT 1", schema, dbQuoteString(conn, name)) + dbGetQuery(conn, query) } ) diff --git a/R/metis-package.R b/R/metis-package.R index 0a7766f..0acff74 100644 --- a/R/metis-package.R +++ b/R/metis-package.R @@ -3,11 +3,13 @@ #' Including a lightweight RJDBC shim. #' #' @name metis +#' @encoding UTF-8 #' @docType package #' @author Bob Rudis (bob@@rud.is) #' @import RJDBC #' @import DBI #' @import dplyr +#' @importFrom readr type_convert #' @importFrom aws.signature use_credentials read_credentials NULL diff --git a/README.Rmd b/README.Rmd index fd8ef69..10af18c 100644 --- a/README.Rmd +++ b/README.Rmd @@ -1,38 +1,58 @@ --- output: rmarkdown::github_document --- +![](https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Winged_goddess_Louvre_F32.jpg/300px-Winged_goddess_Louvre_F32.jpg) + +# `metis` -[`metis`](https://en.wikipedia.org/wiki/Metis_(mythology)) : Helpers for Accessing and Querying Amazon Athena +Helpers for Accessing and Querying Amazon Athena Including a lightweight RJDBC shim. -![](https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Winged_goddess_Louvre_F32.jpg/300px-Winged_goddess_Louvre_F32.jpg) +In Greek mythology, Metis was Athena's "helper". -THIS IS SUPER ALPHA QUALITY. NOTHING TO SEE HERE. MOVE ALONG. +## Description + +Still fairly beta-quality level but getting there. The goal will be to get around enough of the "gotchas" that are preventing raw RJDBC Athena connections from "just working" with `dplyr` v0.6.0+ and also get around the [`fetchSize` problem](https://www.reddit.com/r/aws/comments/6aq22b/fetchsize_limit/) without having to not use `dbGetQuery()`. -It will also support more than the vanilla id/secret auth mechism (it currently support the default basic auth and temp token auth, the latter via environment variables). - -This package includes the `AthenaJDBC41-1.1.0.jar` JAR file out of convenience but that will likely move to a separate package as this gets closer to prime time. +The `AthenaJDBC41-1.1.0.jar` JAR file is included out of convenience but that will likely move to a separate package as this gets closer to prime time if this goes on CRAN. See the **Usage** section for an example. +## What's Inside The Tin? + The following functions are implemented: -- `athena_connect`: Make a JDBC connection to Athena (this returns an `AthenaConnection` object which is a super-class of it's RJDBC vanilla counterpart) -- `read_credentials`: Use Credentials from .aws/credentials File -- `use_credentials`: Use Credentials from .aws/credentials File -- `Athena`: AthenaJDBC` +Easy-interface connection helper: + +- `athena_connect` Make a JDBC connection to Athena + +Custom JDBC Classes: + +- `Athena`: AthenaJDBC (make a new Athena con obj) - `AthenaConnection-class`: AthenaJDBC - `AthenaDriver-class`: AthenaJDBC - `AthenaResult-class`: AthenaJDBC + +Custom JDBC Class Methods: + - `dbConnect-method`: AthenaJDBC +- `dbExistsTable-method`: AthenaJDBC - `dbGetQuery-method`: AthenaJDBC +- `dbListFields-method`: AthenaJDBC +- `dbListTables-method`: AthenaJDBC +- `dbReadTable-method`: AthenaJDBC - `dbSendQuery-method`: AthenaJDBC -### Installation +Pulled in from other `cloudyr` pkgs: + +- `read_credentials` Use Credentials from .aws/credentials File +- `use_credentials` Use Credentials from .aws/credentials File + +## Installation ```{r eval=FALSE} devtools::install_github("hrbrmstr/metis") @@ -42,7 +62,7 @@ devtools::install_github("hrbrmstr/metis") options(width=120) ``` -### Usage +## Usage ```{r message=FALSE, warning=FALSE, error=FALSE} library(metis) @@ -53,16 +73,26 @@ packageVersion("metis") ``` ```{r message=FALSE, warning=FALSE, error=FALSE} -use_credentials("personal") +use_credentials("default") -ath <- athena_connect(default_schema = "sampledb", - s3_staging_dir = "s3://accessible-bucket", - log_path = "/tmp/athena.log", - log_level = "DEBUG") +athena_connect( + default_schema = "sampledb", + s3_staging_dir = "s3://accessible-bucket", + log_path = "/tmp/athena.log", + log_level = "DEBUG" +) -> ath -dbListTables(ath) +dbListTables(ath, schema="sampledb") + +dbExistsTable(ath, "elb_logs", schema="sampledb") + +dbListFields(ath, "elb_logs", "sampledb") dbGetQuery(ath, "SELECT * FROM sampledb.elb_logs LIMIT 10") %>% type_convert() %>% glimpse() ``` + +## Code of Conduct + +Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms. diff --git a/README.md b/README.md index 4418826..e9b8eeb 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,67 @@ -[`metis`](https://en.wikipedia.org/wiki/Metis_(mythology)) : Helpers for Accessing and Querying Amazon Athena +![](https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Winged_goddess_Louvre_F32.jpg/300px-Winged_goddess_Louvre_F32.jpg) + +# `metis` + +Helpers for Accessing and Querying Amazon Athena Including a lightweight RJDBC shim. -![](https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Winged_goddess_Louvre_F32.jpg/300px-Winged_goddess_Louvre_F32.jpg) +In Greek mythology, Metis was Athena’s “helper”. -THIS IS SUPER ALPHA QUALITY. NOTHING TO SEE HERE. MOVE ALONG. +## Description -The goal will be to get around enough of the "gotchas" that are preventing raw RJDBC Athena connecitons from "just working" with `dplyr` v0.6.0+ and also get around the [`fetchSize` problem](https://www.reddit.com/r/aws/comments/6aq22b/fetchsize_limit/) without having to not use `dbGetQuery()`. +Still fairly beta-quality level but getting there. -It will also support more than the vanilla id/secret auth mechism (it currently support the default basic auth and temp token auth, the latter via environment variables). +The goal will be to get around enough of the “gotchas” that are +preventing raw RJDBC Athena connections from “just working” with `dplyr` +v0.6.0+ and also get around the [`fetchSize` +problem](https://www.reddit.com/r/aws/comments/6aq22b/fetchsize_limit/) +without having to not use `dbGetQuery()`. -This package includes the `AthenaJDBC41-1.1.0.jar` JAR file out of convenience but that will likely move to a separate package as this gets closer to prime time. +The `AthenaJDBC41-1.1.0.jar` JAR file is included out of convenience but +that will likely move to a separate package as this gets closer to prime +time if this goes on CRAN. See the **Usage** section for an example. +## What’s Inside The Tin? + The following functions are implemented: -- `athena_connect`: Make a JDBC connection to Athena (this returns an `AthenaConnection` object which is a super-class of it's RJDBC vanilla counterpart) -- `read_credentials`: Use Credentials from .aws/credentials File -- `use_credentials`: Use Credentials from .aws/credentials File -- `Athena`: AthenaJDBC\` -- `AthenaConnection-class`: AthenaJDBC -- `AthenaDriver-class`: AthenaJDBC -- `AthenaResult-class`: AthenaJDBC -- `dbConnect-method`: AthenaJDBC -- `dbGetQuery-method`: AthenaJDBC -- `dbSendQuery-method`: AthenaJDBC +Easy-interface connection helper: + + - `athena_connect` Make a JDBC connection to Athena + +Custom JDBC Classes: + + - `Athena`: AthenaJDBC (make a new Athena con obj) + - `AthenaConnection-class`: AthenaJDBC + - `AthenaDriver-class`: AthenaJDBC + - `AthenaResult-class`: AthenaJDBC + +Custom JDBC Class Methods: + + - `dbConnect-method`: AthenaJDBC + - `dbExistsTable-method`: AthenaJDBC + - `dbGetQuery-method`: AthenaJDBC + - `dbListFields-method`: AthenaJDBC + - `dbListTables-method`: AthenaJDBC + - `dbReadTable-method`: AthenaJDBC + - `dbSendQuery-method`: AthenaJDBC + +Pulled in from other `cloudyr` pkgs: -### Installation + - `read_credentials` Use Credentials from .aws/credentials File + - `use_credentials` Use Credentials from .aws/credentials File + +## Installation ``` r devtools::install_github("hrbrmstr/metis") ``` -### Usage +## Usage ``` r library(metis) @@ -44,22 +71,39 @@ library(tidyverse) packageVersion("metis") ``` - ## [1] '0.1.0' + ## [1] '0.2.0' ``` r -use_credentials("personal") +use_credentials("default") -ath <- athena_connect(default_schema = "sampledb", - s3_staging_dir = "s3://accessible-bucket", - log_path = "/tmp/athena.log", - log_level = "DEBUG") +athena_connect( + default_schema = "sampledb", + s3_staging_dir = "s3://accessible-bucket", + log_path = "/tmp/athena.log", + log_level = "DEBUG" +) -> ath -dbListTables(ath) +dbListTables(ath, schema="sampledb") ``` ## [1] "elb_logs" ``` r +dbExistsTable(ath, "elb_logs", schema="sampledb") +``` + + ## [1] TRUE + +``` r +dbListFields(ath, "elb_logs", "sampledb") +``` + + ## [1] "timestamp" "elbname" "requestip" "requestport" + ## [5] "backendip" "backendport" "requestprocessingtime" "backendprocessingtime" + ## [9] "clientresponsetime" "elbresponsecode" "backendresponsecode" "receivedbytes" + ## [13] "sentbytes" "requestverb" "url" "protocol" + +``` r dbGetQuery(ath, "SELECT * FROM sampledb.elb_logs LIMIT 10") %>% type_convert() %>% glimpse() @@ -67,19 +111,25 @@ dbGetQuery(ath, "SELECT * FROM sampledb.elb_logs LIMIT 10") %>% ## Observations: 10 ## Variables: 16 - ## $ timestamp 2014-09-26 23:00:27, 2014-09-26 23:00:40, 2014-09-26 23:00:57, 2014-09-26 23:01:10, ... + ## $ timestamp 2014-09-30 01:03:00, 2014-09-30 01:03:01, 2014-09-30 01:03:01, 2014-09-30 01:03:01, ... ## $ elbname "lb-demo", "lb-demo", "lb-demo", "lb-demo", "lb-demo", "lb-demo", "lb-demo", "lb-demo... - ## $ requestip "250.244.91.129", "245.151.134.252", "250.144.139.199", "242.201.196.167", "253.206.1... - ## $ requestport 30339, 30339, 30339, 30339, 30339, 30339, 30339, 30339, 30339, 30339 - ## $ backendip "249.70.230.218", "240.86.17.179", "240.204.230.249", "254.88.26.13", "245.227.117.51... - ## $ backendport 8000, 80, 8888, 8899, 8888, 8888, 8888, 8888, 8888, 8888 - ## $ requestprocessingtime 0.000082, 0.000093, 0.000094, 0.000101, 0.000092, 0.000091, 0.000093, 0.000089, 0.000... - ## $ backendprocessingtime 0.047690, 0.047722, 0.039022, 0.046465, 0.046841, 0.042139, 0.040092, 0.048087, 0.039... - ## $ clientresponsetime 7.2e-05, 5.1e-05, 6.4e-05, 6.4e-05, 4.9e-05, 4.7e-05, 5.1e-05, 7.4e-05, 5.4e-05, 5.4e-05 - ## $ elbresponsecode 200, 200, 200, 200, 200, 200, 200, 200, 200, 200 - ## $ backendresponsecode 200, 200, 404, 400, 500, 200, 200, 200, 200, 200 + ## $ requestip "253.90.22.60", "253.51.141.83", "245.59.222.144", "241.35.85.250", "246.245.70.48", ... + ## $ requestport 4095, 14668, 29796, 38607, 32750, 10182, 64948, 51279, 13331, 2700 + ## $ backendip "250.133.18.39", "248.214.120.18", "250.38.70.52", "249.45.101.192", "249.28.120.9", ... + ## $ backendport 8888, 443, 8899, 8888, 8888, 8888, 8888, 8888, 8888, 8000 + ## $ requestprocessingtime 7.3e-05, 8.9e-05, 4.5e-05, 4.3e-05, 7.6e-05, 7.3e-05, 7.7e-05, 4.6e-05, 4.9e-05, 5.3e-05 + ## $ backendprocessingtime 0.561864, 0.021517, 0.019530, 0.018937, 0.022727, 0.390384, 0.017017, 0.016437, 0.019... + ## $ clientresponsetime 9.0e-05, 7.0e-05, 3.0e-05, 3.3e-05, 3.2e-05, 8.4e-05, 5.2e-05, 7.1e-05, 6.9e-05, 5.4e-05 + ## $ elbresponsecode 200, 304, 304, 304, 200, 200, 304, 304, 200, 304 + ## $ backendresponsecode 200, 200, 403, 200, 200, 400, 200, 200, 200, 200 ## $ receivedbytes 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - ## $ sentbytes 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + ## $ sentbytes 58402, 0, 0, 0, 152213, 58402, 0, 0, 152213, 0 ## $ requestverb "GET", "GET", "GET", "GET", "GET", "GET", "GET", "GET", "GET", "GET" - ## $ url "http://www.abcxyz.com:80/jobbrowser/?format=json&state=running&user=15llx5s", "http:... + ## $ url "http://www.abcxyz.com:80/", "http://www.abcxyz.com:80/static/css/hue3.css", "http://... ## $ protocol "HTTP/1.1", "HTTP/1.1", "HTTP/1.1", "HTTP/1.1", "HTTP/1.1", "HTTP/1.1", "HTTP/1.1", "... + +## Code of Conduct + +Please note that this project is released with a [Contributor Code of +Conduct](CONDUCT.md). By participating in this project you agree to +abide by its terms. diff --git a/man/dbConnect-AthenaDriver-method.Rd b/man/dbConnect-AthenaDriver-method.Rd index d73fd9d..76b8dd6 100644 --- a/man/dbConnect-AthenaDriver-method.Rd +++ b/man/dbConnect-AthenaDriver-method.Rd @@ -6,13 +6,32 @@ \title{AthenaJDBC} \usage{ \S4method{dbConnect}{AthenaDriver}(drv, - provider = "com.amazonaws.athena.jdbc.shaded.com.amazonaws.auth.EnvironmentVariableCredentialsProvider", + provider = "com.amazonaws.athena.jdbc.shaded.com.amazonaws.auth.DefaultAWSCredentialsProviderChain", region = "us-east-1", s3_staging_dir = Sys.getenv("AWS_S3_STAGING_DIR"), schema_name = "default", max_error_retries = 10, connection_timeout = 10000, socket_timeout = 10000, retry_base_delay = 100, retry_max_backoff_time = 1000, log_path, log_level, ...) } +\arguments{ +\item{provider}{JDBC auth provider (ideally leave default)} + +\item{region}{AWS region the Athena tables are in} + +\item{s3_staging_dir}{A write-able bucket on S3 that you have permissions for} + +\item{schema_name}{LOL if only this actually worked with Amazon's hacked Presto driver} + +\item{max_error_retries, connection_timeout, socket_timeout, retry_base_delay, retry_max_backoff_time}{technical connection info that you should only muck with if you know what you're doing.} + +\item{log_path, log_level}{The Athena JDBC driver can (shockingly) provide a decent bit +of data in logs. Set this to a temporary directory or somethign log4j can use.} + +\item{...}{unused} +} \description{ AthenaJDBC } +\references{ + +} diff --git a/man/dbExistsTable-AthenaConnection-character-method.Rd b/man/dbExistsTable-AthenaConnection-character-method.Rd new file mode 100644 index 0000000..c871f61 --- /dev/null +++ b/man/dbExistsTable-AthenaConnection-character-method.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/jdbc.r +\docType{methods} +\name{dbExistsTable,AthenaConnection,character-method} +\alias{dbExistsTable,AthenaConnection,character-method} +\title{AthenaJDBC} +\usage{ +\S4method{dbExistsTable}{AthenaConnection,character}(conn, name, schema, ...) +} +\arguments{ +\item{conn}{Athena connection} + +\item{name}{table name} + +\item{schema}{Athena schema name} + +\item{...}{unused} +} +\description{ +AthenaJDBC +} diff --git a/man/dbGetQuery-AthenaConnection-character-method.Rd b/man/dbGetQuery-AthenaConnection-character-method.Rd index 89330f4..aa9b744 100644 --- a/man/dbGetQuery-AthenaConnection-character-method.Rd +++ b/man/dbGetQuery-AthenaConnection-character-method.Rd @@ -5,7 +5,15 @@ \alias{dbGetQuery,AthenaConnection,character-method} \title{AthenaJDBC} \usage{ -\S4method{dbGetQuery}{AthenaConnection,character}(conn, statement, ...) +\S4method{dbGetQuery}{AthenaConnection,character}(conn, statement, + type_convert = FALSE, ...) +} +\arguments{ +\item{conn}{Athena connection} + +\item{statement}{SQL statement} + +\item{...}{unused} } \description{ AthenaJDBC diff --git a/man/dbListFields-AthenaConnection-character-method.Rd b/man/dbListFields-AthenaConnection-character-method.Rd new file mode 100644 index 0000000..4194f5a --- /dev/null +++ b/man/dbListFields-AthenaConnection-character-method.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/jdbc.r +\docType{methods} +\name{dbListFields,AthenaConnection,character-method} +\alias{dbListFields,AthenaConnection,character-method} +\title{AthenaJDBC} +\usage{ +\S4method{dbListFields}{AthenaConnection,character}(conn, name, schema, ...) +} +\arguments{ +\item{conn}{Athena connection} + +\item{name}{table name} + +\item{schema}{Athena schema name} + +\item{...}{unused} +} +\description{ +AthenaJDBC +} diff --git a/man/dbListTables-AthenaConnection-method.Rd b/man/dbListTables-AthenaConnection-method.Rd new file mode 100644 index 0000000..ca3f8d1 --- /dev/null +++ b/man/dbListTables-AthenaConnection-method.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/jdbc.r +\docType{methods} +\name{dbListTables,AthenaConnection-method} +\alias{dbListTables,AthenaConnection-method} +\title{AthenaJDBC} +\usage{ +\S4method{dbListTables}{AthenaConnection}(conn, pattern = "\%", schema, ...) +} +\arguments{ +\item{conn}{Athena connection} + +\item{pattern}{table name pattern} + +\item{schema}{Athena schema name} + +\item{...}{unused} +} +\description{ +AthenaJDBC +} diff --git a/man/dbReadTable-AthenaConnection-character-method.Rd b/man/dbReadTable-AthenaConnection-character-method.Rd new file mode 100644 index 0000000..cd02a94 --- /dev/null +++ b/man/dbReadTable-AthenaConnection-character-method.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/jdbc.r +\docType{methods} +\name{dbReadTable,AthenaConnection,character-method} +\alias{dbReadTable,AthenaConnection,character-method} +\title{AthenaJDBC} +\usage{ +\S4method{dbReadTable}{AthenaConnection,character}(conn, name, schema, ...) +} +\arguments{ +\item{conn}{Athena connection} + +\item{name}{table name} + +\item{schema}{Athena schema name} + +\item{...}{unused} +} +\description{ +AthenaJDBC +} diff --git a/man/dbSendQuery-AthenaConnection-character-method.Rd b/man/dbSendQuery-AthenaConnection-character-method.Rd new file mode 100644 index 0000000..d84be40 --- /dev/null +++ b/man/dbSendQuery-AthenaConnection-character-method.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/jdbc.r +\docType{methods} +\name{dbSendQuery,AthenaConnection,character-method} +\alias{dbSendQuery,AthenaConnection,character-method} +\title{AthenaJDBC} +\usage{ +\S4method{dbSendQuery}{AthenaConnection,character}(conn, statement, ...) +} +\arguments{ +\item{conn}{Athena connection} + +\item{statement}{SQL statement} + +\item{...}{unused} +} +\description{ +AthenaJDBC +} diff --git a/man/dbSendQuery-AthenaDriver-ANY-method.Rd b/man/dbSendQuery-AthenaDriver-ANY-method.Rd deleted file mode 100644 index c2d8c60..0000000 --- a/man/dbSendQuery-AthenaDriver-ANY-method.Rd +++ /dev/null @@ -1,12 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/jdbc.r -\docType{methods} -\name{dbSendQuery,AthenaDriver,ANY-method} -\alias{dbSendQuery,AthenaDriver,ANY-method} -\title{AthenaJDBC} -\usage{ -\S4method{dbSendQuery}{AthenaDriver,ANY}(conn, statement, ...) -} -\description{ -AthenaJDBC -} diff --git a/man/metis.Rd b/man/metis.Rd index e6adc99..faad773 100644 --- a/man/metis.Rd +++ b/man/metis.Rd @@ -1,6 +1,7 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/metis-package.R \docType{package} +\encoding{UTF-8} \name{metis} \alias{metis} \alias{metis-package}