Browse Source

beta-update

boB Rudis 1 year ago
parent
commit
4597f96301
No known key found for this signature in database

+ 1
- 0
.Rbuildignore View File

@@ -8,3 +8,4 @@
8 8
 ^\.codecov\.yml$
9 9
 ^README_files$
10 10
 ^doc$
11
+^CONDUCT\.md$

+ 1
- 0
.bash_profile View File

@@ -0,0 +1 @@
1
+export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/RHome

+ 25
- 0
CONDUCT.md View File

@@ -0,0 +1,25 @@
1
+# Contributor Code of Conduct
2
+
3
+As contributors and maintainers of this project, we pledge to respect all people who 
4
+contribute through reporting issues, posting feature requests, updating documentation,
5
+submitting pull requests or patches, and other activities.
6
+
7
+We are committed to making participation in this project a harassment-free experience for
8
+everyone, regardless of level of experience, gender, gender identity and expression,
9
+sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
10
+
11
+Examples of unacceptable behavior by participants include the use of sexual language or
12
+imagery, derogatory comments or personal attacks, trolling, public or private harassment,
13
+insults, or other unprofessional conduct.
14
+
15
+Project maintainers have the right and responsibility to remove, edit, or reject comments,
16
+commits, code, wiki edits, issues, and other contributions that are not aligned to this 
17
+Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed 
18
+from the project team.
19
+
20
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by 
21
+opening an issue or contacting one or more of the project maintainers.
22
+
23
+This Code of Conduct is adapted from the Contributor Covenant 
24
+(http:contributor-covenant.org), version 1.0.0, available at 
25
+http://contributor-covenant.org/version/1/0/0/

+ 10
- 5
DESCRIPTION View File

@@ -1,11 +1,16 @@
1 1
 Package: metis
2 2
 Type: Package
3 3
 Title: Helpers for Accessing and Querying Amazon Athena
4
-Version: 0.1.0
5
-Date: 2017-05-16
6
-Author: Bob Rudis (bob@rud.is)
4
+Version: 0.2.0
5
+Date: 2018-03-19
6
+Authors@R: c(
7
+    person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"), 
8
+    comment = c(ORCID = "0000-0001-5670-2640"))
9
+  )
7 10
 Maintainer: Bob Rudis <bob@rud.is>
8
-Description: Helpers for Accessing and Querying Amazon Athena. Including a lightweight RJDBC shim.
11
+Encoding: UTF-8 
12
+Description: Helpers for Accessing and Querying Amazon Athena. Including a 
13
+    lightweight RJDBC shim.
9 14
 URL: https://github.com/hrbrmstr/metis
10 15
 BugReports: https://github.com/hrbrmstr/metis/issues
11 16
 License: AGPL
@@ -19,4 +24,4 @@ Imports:
19 24
     DBI,
20 25
     dplyr,
21 26
     aws.signature
22
-RoxygenNote: 6.0.1
27
+RoxygenNote: 6.0.1.9000

+ 5
- 0
NAMESPACE View File

@@ -8,10 +8,15 @@ exportClasses(AthenaConnection)
8 8
 exportClasses(AthenaDriver)
9 9
 exportClasses(AthenaResult)
10 10
 exportMethods(dbConnect)
11
+exportMethods(dbExistsTable)
11 12
 exportMethods(dbGetQuery)
13
+exportMethods(dbListFields)
14
+exportMethods(dbListTables)
15
+exportMethods(dbReadTable)
12 16
 exportMethods(dbSendQuery)
13 17
 import(DBI)
14 18
 import(RJDBC)
15 19
 import(dplyr)
16 20
 importFrom(aws.signature,read_credentials)
17 21
 importFrom(aws.signature,use_credentials)
22
+importFrom(readr,type_convert)

+ 9
- 0
NEWS.md View File

@@ -1,3 +1,12 @@
1
+0.2.0
2
+=========
3
+
4
+- Updated authentication provider to be `com.amazonaws.athena.jdbc.shaded.com.amazonaws.auth.DefaultAWSCredentialsProviderChain` (via @dabdine)
5
+- Now supports additional DBI/RJDBC methods including: `dbExistsTable()`,
6
+  `dbListFields()`, `dbListTables()`, `dbReadTable()`
7
+- More documentation
8
+- Added code of conduct
9
+
1 10
 0.1.0 
2 11
 =========
3 12
 

+ 118
- 25
R/jdbc.r View File

@@ -1,20 +1,38 @@
1 1
 #' AthenaJDBC
2 2
 #'
3 3
 #' @export
4
-setClass("AthenaDriver", representation("JDBCDriver", identifier.quote="character", jdrv="jobjRef"))
4
+setClass(
5
+
6
+  "AthenaDriver",
7
+  representation("JDBCDriver", identifier.quote="character", jdrv="jobjRef")
8
+
9
+)
5 10
 
6 11
 #' AthenaJDBC
7 12
 #'
8 13
 #' @export
9 14
 Athena <- function(identifier.quote='`') {
15
+
10 16
   drv <- JDBC(driverClass="com.amazonaws.athena.jdbc.AthenaDriver",
11 17
               system.file("AthenaJDBC41-1.1.0.jar", package="metis"),
12 18
               identifier.quote=identifier.quote)
19
+
13 20
   return(as(drv, "AthenaDriver"))
21
+
14 22
 }
15 23
 
16 24
 #' AthenaJDBC
17 25
 #'
26
+#' @param provider JDBC auth provider (ideally leave default)
27
+#' @param region AWS region the Athena tables are in
28
+#' @param s3_staging_dir A write-able bucket on S3 that you have permissions for
29
+#' @param schema_name LOL if only this actually worked with Amazon's hacked Presto driver
30
+#' @param max_error_retries,connection_timeout,socket_timeout,retry_base_delay,retry_max_backoff_time
31
+#'     technical connection info that you should only muck with if you know what you're doing.
32
+#' @param log_path,log_level The Athena JDBC driver can (shockingly) provide a decent bit
33
+#'     of data in logs. Set this to a temporary directory or somethign log4j can use.
34
+#' @param ... unused
35
+#' @references <https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html>
18 36
 #' @export
19 37
 setMethod(
20 38
 
@@ -35,9 +53,9 @@ setMethod(
35 53
                  log_level,
36 54
                  ...) {
37 55
 
38
-    conn_string = sprintf('jdbc:awsathena://athena.%s.amazonaws.com:443/%s', region, schema_name)
39
-
40
-    # if (!is.null(provider)) {
56
+    conn_string = sprintf(
57
+      'jdbc:awsathena://athena.%s.amazonaws.com:443/%s', region, schema_name
58
+    )
41 59
 
42 60
     jc <- callNextMethod(drv, conn_string,
43 61
                          s3_staging_dir = s3_staging_dir,
@@ -52,24 +70,6 @@ setMethod(
52 70
                          aws_credentials_provider_class = provider,
53 71
                          ...)
54 72
 
55
-    # } else {
56
-    #
57
-    #   jc <- callNextMethod(drv, conn_string,
58
-    #                        schema_name = schema_name,
59
-    #                        max_error_retries = max_error_retries,
60
-    #                        connection_timeout = connection_timeout,
61
-    #                        socket_timeout = socket_timeout,
62
-    #                        retry_base_delay = retry_base_delay,
63
-    #                        retry_max_backoff_time = retry_max_backoff_time,
64
-    #                        s3_staging_dir = s3_staging_dir,
65
-    #                        schema_name = schema_name,
66
-    #                        log_path = log_path,
67
-    #                        log_level = log_level,
68
-    #                        user = Sys.getenv("AWS_ACCESS_KEY_ID"),
69
-    #                        password = Sys.getenv("AWS_SECRET_ACCESS_KEY"))
70
-    #
71
-    # }
72
-
73 73
     return(as(jc, "AthenaConnection"))
74 74
 
75 75
   }
@@ -88,11 +88,14 @@ setClass("AthenaResult", contains = "JDBCResult")
88 88
 
89 89
 #' AthenaJDBC
90 90
 #'
91
+#' @param conn Athena connection
92
+#' @param statement SQL statement
93
+#' @param ... unused
91 94
 #' @export
92 95
 setMethod(
93 96
 
94 97
   "dbSendQuery",
95
-  "AthenaDriver",
98
+  signature(conn="AthenaConnection", statement="character"),
96 99
 
97 100
   def = function(conn, statement, ...) {
98 101
     return(as(callNextMethod(), "AthenaResult"))
@@ -102,16 +105,106 @@ setMethod(
102 105
 
103 106
 #' AthenaJDBC
104 107
 #'
108
+#' @param conn Athena connection
109
+#' @param statement SQL statement
110
+#' @param ... unused
105 111
 #' @export
106 112
 setMethod(
107 113
 
108 114
   "dbGetQuery",
109 115
   signature(conn="AthenaConnection", statement="character"),
110 116
 
111
-  def = function(conn, statement, ...) {
117
+  def = function(conn, statement, type_convert=FALSE, ...) {
112 118
     r <- dbSendQuery(conn, statement, ...)
113 119
     on.exit(.jcall(r@stat, "V", "close"))
114
-    dplyr::tbl_df(fetch(r, -1, block=1000))
120
+    res <- dplyr::tbl_df(fetch(r, -1, block=1000))
121
+    if (type_convert) res <- readr::type_convert(res)
122
+    res
123
+  }
124
+
125
+)
126
+#' AthenaJDBC
127
+#'
128
+#' @param conn Athena connection
129
+#' @param pattern table name pattern
130
+#' @param schema Athena schema name
131
+#' @param ... unused
132
+#' @export
133
+setMethod(
134
+
135
+  "dbListTables",
136
+  signature(conn="AthenaConnection"),
137
+
138
+  def = function(conn, pattern='*', schema, ...) {
139
+
140
+    if (missing(pattern)) {
141
+      dbGetQuery(
142
+        conn, sprintf("SHOW TABLES IN %s", schema)
143
+      ) -> x
144
+    } else {
145
+      dbGetQuery(
146
+        conn, sprintf("SHOW TABLES IN %s %s", schema, dbQuoteString(conn, pattern))
147
+      ) -> x
148
+    }
149
+
150
+    x$tab_name
151
+  }
152
+
153
+)
154
+
155
+#' AthenaJDBC
156
+#'
157
+#' @param conn Athena connection
158
+#' @param name table name
159
+#' @param schema Athena schema name
160
+#' @param ... unused
161
+#' @export
162
+setMethod(
163
+
164
+  "dbExistsTable",
165
+  signature(conn="AthenaConnection", name="character"),
166
+
167
+  def = function(conn, name, schema, ...) {
168
+    length(dbListTables(conn, schema=schema, pattern=name)) > 0
169
+  }
170
+
171
+)
172
+
173
+#' AthenaJDBC
174
+#'
175
+#' @param conn Athena connection
176
+#' @param name table name
177
+#' @param schema Athena schema name
178
+#' @param ... unused
179
+#' @export
180
+setMethod(
181
+
182
+  "dbListFields",
183
+  signature(conn="AthenaConnection", name="character"),
184
+
185
+  def = function(conn, name, schema, ...) {
186
+    query <- sprintf("SELECT * FROM %s.%s LIMIT 1", schema, name)
187
+    res <- dbGetQuery(conn, query)
188
+    colnames(res)
189
+  }
190
+
191
+)
192
+
193
+#' AthenaJDBC
194
+#'
195
+#' @param conn Athena connection
196
+#' @param name table name
197
+#' @param schema Athena schema name
198
+#' @param ... unused
199
+#' @export
200
+setMethod(
201
+
202
+  "dbReadTable",
203
+  signature(conn="AthenaConnection", name="character"),
204
+
205
+  def = function(conn, name, schema, ...) {
206
+    query <- sprintf("SELECT * FROM %s.%s LIMIT 1", schema, dbQuoteString(conn, name))
207
+    dbGetQuery(conn, query)
115 208
   }
116 209
 
117 210
 )

+ 2
- 0
R/metis-package.R View File

@@ -3,11 +3,13 @@
3 3
 #' Including a lightweight RJDBC shim.
4 4
 #'
5 5
 #' @name metis
6
+#' @encoding UTF-8
6 7
 #' @docType package
7 8
 #' @author Bob Rudis (bob@@rud.is)
8 9
 #' @import RJDBC
9 10
 #' @import DBI
10 11
 #' @import dplyr
12
+#' @importFrom readr type_convert
11 13
 #' @importFrom aws.signature use_credentials read_credentials
12 14
 NULL
13 15
 

+ 48
- 18
README.Rmd View File

@@ -1,38 +1,58 @@
1 1
 ---
2 2
 output: rmarkdown::github_document
3 3
 ---
4
+![](https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Winged_goddess_Louvre_F32.jpg/300px-Winged_goddess_Louvre_F32.jpg)
5
+
6
+# `metis`
4 7
 
5
-[`metis`](https://en.wikipedia.org/wiki/Metis_(mythology)) : Helpers for Accessing and Querying Amazon Athena
8
+Helpers for Accessing and Querying Amazon Athena
6 9
 
7 10
 Including a lightweight RJDBC shim.
8 11
 
9
-![](https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Winged_goddess_Louvre_F32.jpg/300px-Winged_goddess_Louvre_F32.jpg)
12
+In Greek mythology, Metis was Athena's "helper".
10 13
 
11
-THIS IS SUPER ALPHA QUALITY. NOTHING TO SEE HERE. MOVE ALONG.
14
+## Description
15
+
16
+Still fairly beta-quality level but getting there.
12 17
 
13 18
 The goal will be to get around enough of the "gotchas" that are preventing raw RJDBC Athena
14 19
 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()`.
15 20
 
16
-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).
17
-
18
-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.
21
+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.
19 22
 
20 23
 See the **Usage** section for an example.
21 24
 
25
+## What's Inside The Tin?
26
+
22 27
 The following functions are implemented:
23 28
 
24
-- `athena_connect`:	Make a JDBC connection to Athena (this returns an `AthenaConnection` object which is a super-class of it's RJDBC vanilla counterpart)
25
-- `read_credentials`:	Use Credentials from .aws/credentials File
26
-- `use_credentials`:	Use Credentials from .aws/credentials File
27
-- `Athena`:	AthenaJDBC`
29
+Easy-interface connection helper:
30
+
31
+- `athena_connect`	Make a JDBC connection to Athena
32
+
33
+Custom JDBC Classes:
34
+
35
+- `Athena`:	AthenaJDBC (make a new Athena con obj)
28 36
 - `AthenaConnection-class`:	AthenaJDBC
29 37
 - `AthenaDriver-class`:	AthenaJDBC
30 38
 - `AthenaResult-class`:	AthenaJDBC
39
+
40
+Custom JDBC Class Methods:
41
+
31 42
 - `dbConnect-method`:	AthenaJDBC
43
+- `dbExistsTable-method`:	AthenaJDBC
32 44
 - `dbGetQuery-method`:	AthenaJDBC
45
+- `dbListFields-method`:	AthenaJDBC
46
+- `dbListTables-method`:	AthenaJDBC
47
+- `dbReadTable-method`:	AthenaJDBC
33 48
 - `dbSendQuery-method`:	AthenaJDBC
34 49
 
35
-### Installation
50
+Pulled in from other `cloudyr` pkgs: 
51
+
52
+- `read_credentials`	Use Credentials from .aws/credentials File
53
+- `use_credentials`	Use Credentials from .aws/credentials File
54
+
55
+## Installation
36 56
 
37 57
 ```{r eval=FALSE}
38 58
 devtools::install_github("hrbrmstr/metis")
@@ -42,7 +62,7 @@ devtools::install_github("hrbrmstr/metis")
42 62
 options(width=120)
43 63
 ```
44 64
 
45
-### Usage
65
+## Usage
46 66
 
47 67
 ```{r message=FALSE, warning=FALSE, error=FALSE}
48 68
 library(metis)
@@ -53,16 +73,26 @@ packageVersion("metis")
53 73
 ```
54 74
 
55 75
 ```{r message=FALSE, warning=FALSE, error=FALSE}
56
-use_credentials("personal")
76
+use_credentials("default")
57 77
 
58
-ath <- athena_connect(default_schema = "sampledb", 
59
-                      s3_staging_dir = "s3://accessible-bucket",
60
-                      log_path = "/tmp/athena.log",
61
-                      log_level = "DEBUG")
78
+athena_connect(
79
+  default_schema = "sampledb", 
80
+  s3_staging_dir = "s3://accessible-bucket",
81
+  log_path = "/tmp/athena.log",
82
+  log_level = "DEBUG"
83
+) -> ath
62 84
 
63
-dbListTables(ath)
85
+dbListTables(ath, schema="sampledb")
86
+
87
+dbExistsTable(ath, "elb_logs", schema="sampledb")
88
+
89
+dbListFields(ath, "elb_logs", "sampledb")
64 90
 
65 91
 dbGetQuery(ath, "SELECT * FROM sampledb.elb_logs LIMIT 10") %>% 
66 92
   type_convert() %>% 
67 93
   glimpse()
68 94
 ```
95
+
96
+## Code of Conduct
97
+
98
+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.

+ 87
- 37
README.md View File

@@ -1,40 +1,67 @@
1 1
 
2
-[`metis`](https://en.wikipedia.org/wiki/Metis_(mythology)) : Helpers for Accessing and Querying Amazon Athena
2
+![](https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Winged_goddess_Louvre_F32.jpg/300px-Winged_goddess_Louvre_F32.jpg)
3
+
4
+# `metis`
5
+
6
+Helpers for Accessing and Querying Amazon Athena
3 7
 
4 8
 Including a lightweight RJDBC shim.
5 9
 
6
-![](https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Winged_goddess_Louvre_F32.jpg/300px-Winged_goddess_Louvre_F32.jpg)
10
+In Greek mythology, Metis was Athena’s “helper”.
7 11
 
8
-THIS IS SUPER ALPHA QUALITY. NOTHING TO SEE HERE. MOVE ALONG.
12
+## Description
9 13
 
10
-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()`.
14
+Still fairly beta-quality level but getting there.
11 15
 
12
-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).
16
+The goal will be to get around enough of the “gotchas” that are
17
+preventing raw RJDBC Athena connections from “just working” with `dplyr`
18
+v0.6.0+ and also get around the [`fetchSize`
19
+problem](https://www.reddit.com/r/aws/comments/6aq22b/fetchsize_limit/)
20
+without having to not use `dbGetQuery()`.
13 21
 
14
-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.
22
+The `AthenaJDBC41-1.1.0.jar` JAR file is included out of convenience but
23
+that will likely move to a separate package as this gets closer to prime
24
+time if this goes on CRAN.
15 25
 
16 26
 See the **Usage** section for an example.
17 27
 
28
+## What’s Inside The Tin?
29
+
18 30
 The following functions are implemented:
19 31
 
20
--   `athena_connect`: Make a JDBC connection to Athena (this returns an `AthenaConnection` object which is a super-class of it's RJDBC vanilla counterpart)
21
--   `read_credentials`: Use Credentials from .aws/credentials File
22
--   `use_credentials`: Use Credentials from .aws/credentials File
23
--   `Athena`: AthenaJDBC\`
24
--   `AthenaConnection-class`: AthenaJDBC
25
--   `AthenaDriver-class`: AthenaJDBC
26
--   `AthenaResult-class`: AthenaJDBC
27
--   `dbConnect-method`: AthenaJDBC
28
--   `dbGetQuery-method`: AthenaJDBC
29
--   `dbSendQuery-method`: AthenaJDBC
32
+Easy-interface connection helper:
33
+
34
+  - `athena_connect` Make a JDBC connection to Athena
35
+
36
+Custom JDBC Classes:
37
+
38
+  - `Athena`: AthenaJDBC (make a new Athena con obj)
39
+  - `AthenaConnection-class`: AthenaJDBC
40
+  - `AthenaDriver-class`: AthenaJDBC
41
+  - `AthenaResult-class`: AthenaJDBC
42
+
43
+Custom JDBC Class Methods:
44
+
45
+  - `dbConnect-method`: AthenaJDBC
46
+  - `dbExistsTable-method`: AthenaJDBC
47
+  - `dbGetQuery-method`: AthenaJDBC
48
+  - `dbListFields-method`: AthenaJDBC
49
+  - `dbListTables-method`: AthenaJDBC
50
+  - `dbReadTable-method`: AthenaJDBC
51
+  - `dbSendQuery-method`: AthenaJDBC
52
+
53
+Pulled in from other `cloudyr` pkgs:
30 54
 
31
-### Installation
55
+  - `read_credentials` Use Credentials from .aws/credentials File
56
+  - `use_credentials` Use Credentials from .aws/credentials File
57
+
58
+## Installation
32 59
 
33 60
 ``` r
34 61
 devtools::install_github("hrbrmstr/metis")
35 62
 ```
36 63
 
37
-### Usage
64
+## Usage
38 65
 
39 66
 ``` r
40 67
 library(metis)
@@ -44,22 +71,39 @@ library(tidyverse)
44 71
 packageVersion("metis")
45 72
 ```
46 73
 
47
-    ## [1] '0.1.0'
74
+    ## [1] '0.2.0'
48 75
 
49 76
 ``` r
50
-use_credentials("personal")
77
+use_credentials("default")
51 78
 
52
-ath <- athena_connect(default_schema = "sampledb", 
53
-                      s3_staging_dir = "s3://accessible-bucket",
54
-                      log_path = "/tmp/athena.log",
55
-                      log_level = "DEBUG")
79
+athena_connect(
80
+  default_schema = "sampledb", 
81
+  s3_staging_dir = "s3://accessible-bucket",
82
+  log_path = "/tmp/athena.log",
83
+  log_level = "DEBUG"
84
+) -> ath
56 85
 
57
-dbListTables(ath)
86
+dbListTables(ath, schema="sampledb")
58 87
 ```
59 88
 
60 89
     ## [1] "elb_logs"
61 90
 
62 91
 ``` r
92
+dbExistsTable(ath, "elb_logs", schema="sampledb")
93
+```
94
+
95
+    ## [1] TRUE
96
+
97
+``` r
98
+dbListFields(ath, "elb_logs", "sampledb")
99
+```
100
+
101
+    ##  [1] "timestamp"             "elbname"               "requestip"             "requestport"          
102
+    ##  [5] "backendip"             "backendport"           "requestprocessingtime" "backendprocessingtime"
103
+    ##  [9] "clientresponsetime"    "elbresponsecode"       "backendresponsecode"   "receivedbytes"        
104
+    ## [13] "sentbytes"             "requestverb"           "url"                   "protocol"
105
+
106
+``` r
63 107
 dbGetQuery(ath, "SELECT * FROM sampledb.elb_logs LIMIT 10") %>% 
64 108
   type_convert() %>% 
65 109
   glimpse()
@@ -67,19 +111,25 @@ dbGetQuery(ath, "SELECT * FROM sampledb.elb_logs LIMIT 10") %>%
67 111
 
68 112
     ## Observations: 10
69 113
     ## Variables: 16
70
-    ## $ timestamp             <dttm> 2014-09-26 23:00:27, 2014-09-26 23:00:40, 2014-09-26 23:00:57, 2014-09-26 23:01:10, ...
114
+    ## $ timestamp             <dttm> 2014-09-30 01:03:00, 2014-09-30 01:03:01, 2014-09-30 01:03:01, 2014-09-30 01:03:01, ...
71 115
     ## $ elbname               <chr> "lb-demo", "lb-demo", "lb-demo", "lb-demo", "lb-demo", "lb-demo", "lb-demo", "lb-demo...
72
-    ## $ requestip             <chr> "250.244.91.129", "245.151.134.252", "250.144.139.199", "242.201.196.167", "253.206.1...
73
-    ## $ requestport           <dbl> 30339, 30339, 30339, 30339, 30339, 30339, 30339, 30339, 30339, 30339
74
-    ## $ backendip             <chr> "249.70.230.218", "240.86.17.179", "240.204.230.249", "254.88.26.13", "245.227.117.51...
75
-    ## $ backendport           <dbl> 8000, 80, 8888, 8899, 8888, 8888, 8888, 8888, 8888, 8888
76
-    ## $ requestprocessingtime <dbl> 0.000082, 0.000093, 0.000094, 0.000101, 0.000092, 0.000091, 0.000093, 0.000089, 0.000...
77
-    ## $ backendprocessingtime <dbl> 0.047690, 0.047722, 0.039022, 0.046465, 0.046841, 0.042139, 0.040092, 0.048087, 0.039...
78
-    ## $ clientresponsetime    <dbl> 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
79
-    ## $ elbresponsecode       <int> 200, 200, 200, 200, 200, 200, 200, 200, 200, 200
80
-    ## $ backendresponsecode   <int> 200, 200, 404, 400, 500, 200, 200, 200, 200, 200
116
+    ## $ requestip             <chr> "253.90.22.60", "253.51.141.83", "245.59.222.144", "241.35.85.250", "246.245.70.48", ...
117
+    ## $ requestport           <dbl> 4095, 14668, 29796, 38607, 32750, 10182, 64948, 51279, 13331, 2700
118
+    ## $ backendip             <chr> "250.133.18.39", "248.214.120.18", "250.38.70.52", "249.45.101.192", "249.28.120.9", ...
119
+    ## $ backendport           <dbl> 8888, 443, 8899, 8888, 8888, 8888, 8888, 8888, 8888, 8000
120
+    ## $ requestprocessingtime <dbl> 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
121
+    ## $ backendprocessingtime <dbl> 0.561864, 0.021517, 0.019530, 0.018937, 0.022727, 0.390384, 0.017017, 0.016437, 0.019...
122
+    ## $ clientresponsetime    <dbl> 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
123
+    ## $ elbresponsecode       <int> 200, 304, 304, 304, 200, 200, 304, 304, 200, 304
124
+    ## $ backendresponsecode   <int> 200, 200, 403, 200, 200, 400, 200, 200, 200, 200
81 125
     ## $ receivedbytes         <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
82
-    ## $ sentbytes             <dbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
126
+    ## $ sentbytes             <dbl> 58402, 0, 0, 0, 152213, 58402, 0, 0, 152213, 0
83 127
     ## $ requestverb           <chr> "GET", "GET", "GET", "GET", "GET", "GET", "GET", "GET", "GET", "GET"
84
-    ## $ url                   <chr> "http://www.abcxyz.com:80/jobbrowser/?format=json&state=running&user=15llx5s", "http:...
128
+    ## $ url                   <chr> "http://www.abcxyz.com:80/", "http://www.abcxyz.com:80/static/css/hue3.css", "http://...
85 129
     ## $ protocol              <chr> "HTTP/1.1", "HTTP/1.1", "HTTP/1.1", "HTTP/1.1", "HTTP/1.1", "HTTP/1.1", "HTTP/1.1", "...
130
+
131
+## Code of Conduct
132
+
133
+Please note that this project is released with a [Contributor Code of
134
+Conduct](CONDUCT.md). By participating in this project you agree to
135
+abide by its terms.

+ 20
- 1
man/dbConnect-AthenaDriver-method.Rd View File

@@ -6,13 +6,32 @@
6 6
 \title{AthenaJDBC}
7 7
 \usage{
8 8
 \S4method{dbConnect}{AthenaDriver}(drv,
9
-  provider = "com.amazonaws.athena.jdbc.shaded.com.amazonaws.auth.EnvironmentVariableCredentialsProvider",
9
+  provider = "com.amazonaws.athena.jdbc.shaded.com.amazonaws.auth.DefaultAWSCredentialsProviderChain",
10 10
   region = "us-east-1", s3_staging_dir = Sys.getenv("AWS_S3_STAGING_DIR"),
11 11
   schema_name = "default", max_error_retries = 10,
12 12
   connection_timeout = 10000, socket_timeout = 10000,
13 13
   retry_base_delay = 100, retry_max_backoff_time = 1000, log_path,
14 14
   log_level, ...)
15 15
 }
16
+\arguments{
17
+\item{provider}{JDBC auth provider (ideally leave default)}
18
+
19
+\item{region}{AWS region the Athena tables are in}
20
+
21
+\item{s3_staging_dir}{A write-able bucket on S3 that you have permissions for}
22
+
23
+\item{schema_name}{LOL if only this actually worked with Amazon's hacked Presto driver}
24
+
25
+\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.}
26
+
27
+\item{log_path, log_level}{The Athena JDBC driver can (shockingly) provide a decent bit
28
+of data in logs. Set this to a temporary directory or somethign log4j can use.}
29
+
30
+\item{...}{unused}
31
+}
16 32
 \description{
17 33
 AthenaJDBC
18 34
 }
35
+\references{
36
+<https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html>
37
+}

+ 21
- 0
man/dbExistsTable-AthenaConnection-character-method.Rd View File

@@ -0,0 +1,21 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/jdbc.r
3
+\docType{methods}
4
+\name{dbExistsTable,AthenaConnection,character-method}
5
+\alias{dbExistsTable,AthenaConnection,character-method}
6
+\title{AthenaJDBC}
7
+\usage{
8
+\S4method{dbExistsTable}{AthenaConnection,character}(conn, name, schema, ...)
9
+}
10
+\arguments{
11
+\item{conn}{Athena connection}
12
+
13
+\item{name}{table name}
14
+
15
+\item{schema}{Athena schema name}
16
+
17
+\item{...}{unused}
18
+}
19
+\description{
20
+AthenaJDBC
21
+}

+ 9
- 1
man/dbGetQuery-AthenaConnection-character-method.Rd View File

@@ -5,7 +5,15 @@
5 5
 \alias{dbGetQuery,AthenaConnection,character-method}
6 6
 \title{AthenaJDBC}
7 7
 \usage{
8
-\S4method{dbGetQuery}{AthenaConnection,character}(conn, statement, ...)
8
+\S4method{dbGetQuery}{AthenaConnection,character}(conn, statement,
9
+  type_convert = FALSE, ...)
10
+}
11
+\arguments{
12
+\item{conn}{Athena connection}
13
+
14
+\item{statement}{SQL statement}
15
+
16
+\item{...}{unused}
9 17
 }
10 18
 \description{
11 19
 AthenaJDBC

+ 21
- 0
man/dbListFields-AthenaConnection-character-method.Rd View File

@@ -0,0 +1,21 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/jdbc.r
3
+\docType{methods}
4
+\name{dbListFields,AthenaConnection,character-method}
5
+\alias{dbListFields,AthenaConnection,character-method}
6
+\title{AthenaJDBC}
7
+\usage{
8
+\S4method{dbListFields}{AthenaConnection,character}(conn, name, schema, ...)
9
+}
10
+\arguments{
11
+\item{conn}{Athena connection}
12
+
13
+\item{name}{table name}
14
+
15
+\item{schema}{Athena schema name}
16
+
17
+\item{...}{unused}
18
+}
19
+\description{
20
+AthenaJDBC
21
+}

+ 21
- 0
man/dbListTables-AthenaConnection-method.Rd View File

@@ -0,0 +1,21 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/jdbc.r
3
+\docType{methods}
4
+\name{dbListTables,AthenaConnection-method}
5
+\alias{dbListTables,AthenaConnection-method}
6
+\title{AthenaJDBC}
7
+\usage{
8
+\S4method{dbListTables}{AthenaConnection}(conn, pattern = "\%", schema, ...)
9
+}
10
+\arguments{
11
+\item{conn}{Athena connection}
12
+
13
+\item{pattern}{table name pattern}
14
+
15
+\item{schema}{Athena schema name}
16
+
17
+\item{...}{unused}
18
+}
19
+\description{
20
+AthenaJDBC
21
+}

+ 21
- 0
man/dbReadTable-AthenaConnection-character-method.Rd View File

@@ -0,0 +1,21 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/jdbc.r
3
+\docType{methods}
4
+\name{dbReadTable,AthenaConnection,character-method}
5
+\alias{dbReadTable,AthenaConnection,character-method}
6
+\title{AthenaJDBC}
7
+\usage{
8
+\S4method{dbReadTable}{AthenaConnection,character}(conn, name, schema, ...)
9
+}
10
+\arguments{
11
+\item{conn}{Athena connection}
12
+
13
+\item{name}{table name}
14
+
15
+\item{schema}{Athena schema name}
16
+
17
+\item{...}{unused}
18
+}
19
+\description{
20
+AthenaJDBC
21
+}

+ 19
- 0
man/dbSendQuery-AthenaConnection-character-method.Rd View File

@@ -0,0 +1,19 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/jdbc.r
3
+\docType{methods}
4
+\name{dbSendQuery,AthenaConnection,character-method}
5
+\alias{dbSendQuery,AthenaConnection,character-method}
6
+\title{AthenaJDBC}
7
+\usage{
8
+\S4method{dbSendQuery}{AthenaConnection,character}(conn, statement, ...)
9
+}
10
+\arguments{
11
+\item{conn}{Athena connection}
12
+
13
+\item{statement}{SQL statement}
14
+
15
+\item{...}{unused}
16
+}
17
+\description{
18
+AthenaJDBC
19
+}

+ 0
- 12
man/dbSendQuery-AthenaDriver-ANY-method.Rd View File

@@ -1,12 +0,0 @@
1
-% Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/jdbc.r
3
-\docType{methods}
4
-\name{dbSendQuery,AthenaDriver,ANY-method}
5
-\alias{dbSendQuery,AthenaDriver,ANY-method}
6
-\title{AthenaJDBC}
7
-\usage{
8
-\S4method{dbSendQuery}{AthenaDriver,ANY}(conn, statement, ...)
9
-}
10
-\description{
11
-AthenaJDBC
12
-}

+ 1
- 0
man/metis.Rd View File

@@ -1,6 +1,7 @@
1 1
 % Generated by roxygen2: do not edit by hand
2 2
 % Please edit documentation in R/metis-package.R
3 3
 \docType{package}
4
+\encoding{UTF-8}
4 5
 \name{metis}
5 6
 \alias{metis}
6 7
 \alias{metis-package}

Loading…
Cancel
Save