diff --git a/docs/reference/noctua-package.html b/docs/reference/noctua-package.html
index ef5eeae..20ccc74 100644
--- a/docs/reference/noctua-package.html
+++ b/docs/reference/noctua-package.html
@@ -18,7 +18,7 @@
noctua
- 2.6.0
+ 2.6.1
@@ -122,7 +122,7 @@ Author
diff --git a/docs/reference/noctua_options.html b/docs/reference/noctua_options.html
index 3aeb7e8..19eef6c 100644
--- a/docs/reference/noctua_options.html
+++ b/docs/reference/noctua_options.html
@@ -18,7 +18,7 @@
noctua
- 2.6.0
+ 2.6.1
@@ -83,19 +83,19 @@ A method to configure noctua backend options.
-
noctua_options(
- file_parser,
- bigint,
- binary,
- json,
- cache_size,
- clear_cache,
- retry,
- retry_quiet,
- unload,
- clear_s3_resource,
- verbose
-)
+
noctua_options(
+ file_parser,
+ bigint,
+ binary,
+ json,
+ cache_size,
+ clear_cache,
+ retry,
+ retry_quiet,
+ unload,
+ clear_s3_resource,
+ verbose
+)
@@ -103,47 +103,70 @@
Arguments
- file_parser
Method to read and write tables to Athena, currently default to "data.table"
. The file_parser also
determines the data format returned for example "data.table"
will return data.table
and "vroom"
will return tibble
.
+
+
- bigint
The R type that 64-bit integer types should be mapped to (default: "integer64"
).
Inbuilt bigint
conversion types ["integer64", "integer", "numeric", "character"].
+
+
- binary
The R type that [binary/varbinary] types should be mapped to (default "raw"
).
Inbuilt binary conversion types ["raw", "character"].
+
+
- json
Attempt to converts AWS Athena data types [arrays, json] using jsonlite:parse_json
(default: "auto"
).
Inbuilt json conversion types ["auto", "character"].
Custom Json parsers can be provide by using a function with data frame parameter.
+
+
- cache_size
Number of queries to be cached. Currently only support caching up to 100 distinct queries (default: 0
).
+
+
- clear_cache
Clears all previous cached query metadata
+
+
- retry
Maximum number of requests to attempt (default: 5
).
+
+
- retry_quiet
This method is deprecated please use verbose instead.
+
+
- unload
set AWS Athena unload functionality globally (default: FALSE
)
+
+
- clear_s3_resource
Clear down `AWS Athena` `AWS S3` resource (s3_staging_dir
location).
This is useful for users that don't have the `AWS IAM role` permissions delete
from `s3_staging_dir` (default: TRUE
)
+
+
- verbose
print package info messages (default: TRUE
)
+
Value
-
noctua_options()
returns NULL
, invisibly.
+
+
+
noctua_options()
returns NULL
, invisibly.
Examples
-
library(noctua)
-
-# change file parser from default data.table to vroom
-noctua_options("vroom")
-
-# cache queries locally
-noctua_options(cache_size = 5)
+ library(noctua)
+
+# change file parser from default data.table to vroom
+noctua_options("vroom")
+
+# cache queries locally
+noctua_options(cache_size = 5)
@@ -158,7 +181,7 @@ Examples
diff --git a/docs/reference/session_token.html b/docs/reference/session_token.html
index c3d18c8..83ed010 100644
--- a/docs/reference/session_token.html
+++ b/docs/reference/session_token.html
@@ -17,7 +17,7 @@
noctua
- 2.6.0
+ 2.6.1
@@ -81,14 +81,14 @@ Get Session Tokens for PAWS Connection
-
get_session_token(
- profile_name = NULL,
- region_name = NULL,
- serial_number = NULL,
- token_code = NULL,
- duration_seconds = 3600L,
- set_env = FALSE
-)
+
get_session_token(
+ profile_name = NULL,
+ region_name = NULL,
+ serial_number = NULL,
+ token_code = NULL,
+ duration_seconds = 3600L,
+ set_env = FALSE
+)
@@ -97,47 +97,62 @@
Arguments
The name of a profile to use. If not given, then the default profile is used.
To set profile name, the AWS Command Line Interface (AWS CLI) will need to be configured.
To configure AWS CLI please refer to: Configuring the AWS CLI.
+
+
region_name
Default region when creating new connections. Please refer to link for
AWS region codes (region code example: Region = EU (Ireland) region_name = "eu-west-1"
)
+
+
serial_number
The identification number of the MFA device that is associated with the IAM user who is making the GetSessionToken call.
Specify this value if the IAM user has a policy that requires MFA authentication. The value is either the serial number for a hardware device
(such as `GAHT12345678`) or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user).
+
+
token_code
The value provided by the MFA device, if MFA is required. If any policy requires the IAM user to submit an MFA code,
specify this value. If MFA authentication is required, the user must provide a code when requesting a set of temporary
security credentials. A user who fails to provide the code receives an "access denied" response when requesting resources
that require MFA authentication.
+
+
duration_seconds
The duration, in seconds, that the credentials should remain valid. Acceptable duration for IAM user sessions range
from 900 seconds (15 minutes) to 129,600 seconds (36 hours), with 3,600 seconds (1 hour) as the default.
+
+
set_env
If set to TRUE
environmental variables AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
and AWS_SESSION_TOKEN
will be set.
+
Value
-
get_session_token()
returns a list containing: "AccessKeyId"
, "SecretAccessKey"
, "SessionToken"
and "Expiration"
+
+
+
get_session_token()
returns a list containing: "AccessKeyId"
, "SecretAccessKey"
, "SessionToken"
and "Expiration"
+
+
Examples
-
if (FALSE) {
-# Note:
-# - Require AWS Account to run below example.
-
-library(noctua)
-library(DBI)
-
-# Create Temporary Credentials duration 1 hour
-get_session_token("YOUR_PROFILE_NAME",
- serial_number='arn:aws:iam::123456789012:mfa/user',
- token_code = "531602",
- set_env = TRUE)
-
-# Connect to Athena using temporary credentials
-con <- dbConnect(athena())
-}
+ if (FALSE) {
+# Note:
+# - Require AWS Account to run below example.
+
+library(noctua)
+library(DBI)
+
+# Create Temporary Credentials duration 1 hour
+get_session_token("YOUR_PROFILE_NAME",
+ serial_number='arn:aws:iam::123456789012:mfa/user',
+ token_code = "531602",
+ set_env = TRUE)
+
+# Connect to Athena using temporary credentials
+con <- dbConnect(athena())
+}
@@ -152,7 +167,7 @@ Examples
diff --git a/docs/reference/sqlCreateTable.html b/docs/reference/sqlCreateTable.html
index a1e547d..fb74dda 100644
--- a/docs/reference/sqlCreateTable.html
+++ b/docs/reference/sqlCreateTable.html
@@ -17,7 +17,7 @@
noctua
- 2.6.0
+ 2.6.1
@@ -81,24 +81,26 @@ Creates query to create a simple Athena table
-
# S4 method for AthenaConnection
-sqlCreateTable(
- con,
- table,
- fields,
- field.types = NULL,
- partition = NULL,
- s3.location = NULL,
- file.type = c("tsv", "csv", "parquet", "json"),
- compress = FALSE,
- ...
-)
+
# S4 method for AthenaConnection
+sqlCreateTable(
+ con,
+ table,
+ fields,
+ field.types = NULL,
+ partition = NULL,
+ s3.location = NULL,
+ file.type = c("tsv", "csv", "parquet", "json"),
+ compress = FALSE,
+ ...
+)
Arguments
- con
A database connection.
+
+
- table
The table name, passed on to dbQuoteIdentifier()
. Options are:
a character string with the unquoted DBMS table name,
e.g. "table_name"
,
@@ -107,6 +109,8 @@ Arguments
a call to SQL()
with the quoted and fully qualified table name
given verbatim, e.g. SQL('"my_schema"."table_name"')
+
+
- fields
Either a character vector or a data frame.
A named character vector: Names are column names, values are types.
@@ -114,28 +118,43 @@
Arguments
Field types are unescaped.
A data frame: field types are generated using
dbDataType()
.
+
+
- field.types
Additional field types used to override derived types.
+
+
- partition
Partition Athena table (needs to be a named list or vector) for example: c(var1 = "2019-20-13")
+
+
- s3.location
s3 bucket to store Athena table, must be set as a s3 uri for example ("s3://mybucket/data/").
By default s3.location is set s3 staging directory from AthenaConnection
object.
+
+
- file.type
What file type to store data.frame on s3, noctua currently supports ["tsv", "csv", "parquet", "json"]. Default delimited file type is "tsv", in previous versions
of noctua (=< 1.4.0)
file type "csv" was used as default. The reason for the change is that columns containing Array/JSON
format cannot be written to
Athena due to the separating value ",". This would cause issues with AWS Athena.
Note: "parquet" format is supported by the arrow
package and it will need to be installed to utilise the "parquet" format.
"json" format is supported by jsonlite
package and it will need to be installed to utilise the "json" format.
+
+
- compress
FALSE | TRUE
To determine if to compress file.type. If file type is ["csv", "tsv"] then "gzip" compression is used, for file type "parquet"
"snappy" compression is used. Currently noctua
doesn't support compression for "json" file type.
+
+
- ...
Other arguments used by individual methods.
+
Value
-
sqlCreateTable
returns data.frame's DDL
in the SQL
format.
+
+
+
sqlCreateTable
returns data.frame's DDL
in the SQL
format.
See also
@@ -144,33 +163,33 @@
See also
Examples
-
if (FALSE) {
-# Note:
-# - Require AWS Account to run below example.
-# - Different connection methods can be used please see `noctua::dbConnect` documnentation
-
-library(DBI)
-
-# Demo connection to Athena using profile name
-con <- dbConnect(noctua::athena())
-
-# Create DDL for iris data.frame
-sqlCreateTable(con, "iris", iris, s3.location = "s3://path/to/athena/table")
-
-# Create DDL for iris data.frame with partition
-sqlCreateTable(con, "iris", iris,
- partition = "timestamp",
- s3.location = "s3://path/to/athena/table")
-
-# Create DDL for iris data.frame with partition and file.type parquet
-sqlCreateTable(con, "iris", iris,
- partition = "timestamp",
- s3.location = "s3://path/to/athena/table",
- file.type = "parquet")
-
-# Disconnect from Athena
-dbDisconnect(con)
-}
+ if (FALSE) {
+# Note:
+# - Require AWS Account to run below example.
+# - Different connection methods can be used please see `noctua::dbConnect` documnentation
+
+library(DBI)
+
+# Demo connection to Athena using profile name
+con <- dbConnect(noctua::athena())
+
+# Create DDL for iris data.frame
+sqlCreateTable(con, "iris", iris, s3.location = "s3://path/to/athena/table")
+
+# Create DDL for iris data.frame with partition
+sqlCreateTable(con, "iris", iris,
+ partition = "timestamp",
+ s3.location = "s3://path/to/athena/table")
+
+# Create DDL for iris data.frame with partition and file.type parquet
+sqlCreateTable(con, "iris", iris,
+ partition = "timestamp",
+ s3.location = "s3://path/to/athena/table",
+ file.type = "parquet")
+
+# Disconnect from Athena
+dbDisconnect(con)
+}
@@ -185,7 +204,7 @@
Examples
diff --git a/docs/reference/sqlData.html b/docs/reference/sqlData.html
index 5f0bc6a..cc4a26e 100644
--- a/docs/reference/sqlData.html
+++ b/docs/reference/sqlData.html
@@ -17,7 +17,7 @@
noctua
- 2.6.0
+ 2.6.1
@@ -81,22 +81,26 @@ Converts data frame into suitable format to be uploaded to Athena
-
# S4 method for AthenaConnection
-sqlData(
- con,
- value,
- row.names = NA,
- file.type = c("tsv", "csv", "parquet", "json"),
- ...
-)
+
# S4 method for AthenaConnection
+sqlData(
+ con,
+ value,
+ row.names = NA,
+ file.type = c("tsv", "csv", "parquet", "json"),
+ ...
+)
Arguments
- con
A database connection.
+
+
- value
A data frame
+
+
- row.names
Either TRUE
, FALSE
, NA
or a string.
If TRUE
, always translate row names to a column called "row_names".
@@ -105,15 +109,25 @@
Arguments
A string is equivalent to TRUE
, but allows you to override the
default name.
For backward compatibility, NULL
is equivalent to FALSE
.
+
+
- file.type
What file type to store data.frame on s3, noctua currently supports ["csv", "tsv", "parquet", "json"].
Note: This parameter is used for format any special characters that clash with file type separator.
+
+
- ...
Other arguments used by individual methods.
+
Value
-
sqlData
returns a dataframe formatted for Athena. Currently converts list
variable types into character
split by '|'
, similar to how data.table
writes out to files.
+
+
+
sqlData
returns a dataframe formatted for Athena. Currently converts list
variable types into character
+
+
+
split by '|'
, similar to how data.table
writes out to files.
See also
@@ -132,7 +146,7 @@ See also
diff --git a/docs/reference/sql_translate_env.html b/docs/reference/sql_translate_env.html
index d7185be..2f28dce 100644
--- a/docs/reference/sql_translate_env.html
+++ b/docs/reference/sql_translate_env.html
@@ -19,7 +19,7 @@
noctua
- 2.6.0
+ 2.6.1
@@ -85,11 +85,11 @@ AWS Athena backend dbplyr version 1 and 2
-
sql_translation.AthenaConnection(con)
-
-sql_translate_env.AthenaConnection(con)
-
-sql_escape_string.AthenaConnection(con, x)
+
sql_translation.AthenaConnection(con)
+
+sql_translate_env.AthenaConnection(con)
+
+sql_escape_string.AthenaConnection(con, x)
@@ -97,11 +97,14 @@
Arguments
- con
An AthenaConnection
object, produced by
[DBI::dbConnect()]
+
+
- x
An object to escape. Existing sql vectors will be left as is,
character vectors are escaped with single quotes, numeric vectors have
trailing `.0` added if they're whole numbers, identifiers are
escaped with double quotes.
+
@@ -116,7 +119,7 @@ Arguments
diff --git a/docs/reference/work_group.html b/docs/reference/work_group.html
index b1a4465..4774c74 100644
--- a/docs/reference/work_group.html
+++ b/docs/reference/work_group.html
@@ -43,7 +43,7 @@
noctua
- 2.6.0
+ 2.6.1
@@ -130,52 +130,64 @@ Athena Work Groups
-
create_work_group(
- conn,
- work_group = NULL,
- enforce_work_group_config = FALSE,
- publish_cloud_watch_metrics = FALSE,
- bytes_scanned_cut_off = 10000000L,
- description = NULL,
- tags = tag_options(key = NULL, value = NULL)
-)
-
-tag_options(key = NULL, value = NULL)
-
-delete_work_group(conn, work_group = NULL, recursive_delete_option = FALSE)
-
-list_work_groups(conn)
-
-get_work_group(conn, work_group = NULL)
-
-update_work_group(
- conn,
- work_group = NULL,
- remove_output_location = FALSE,
- enforce_work_group_config = FALSE,
- publish_cloud_watch_metrics = FALSE,
- bytes_scanned_cut_off = 10000000L,
- description = NULL,
- state = c("ENABLED", "DISABLED")
-)
+
create_work_group(
+ conn,
+ work_group = NULL,
+ enforce_work_group_config = FALSE,
+ publish_cloud_watch_metrics = FALSE,
+ bytes_scanned_cut_off = 10000000L,
+ description = NULL,
+ tags = tag_options(key = NULL, value = NULL)
+)
+
+tag_options(key = NULL, value = NULL)
+
+delete_work_group(conn, work_group = NULL, recursive_delete_option = FALSE)
+
+list_work_groups(conn)
+
+get_work_group(conn, work_group = NULL)
+
+update_work_group(
+ conn,
+ work_group = NULL,
+ remove_output_location = FALSE,
+ enforce_work_group_config = FALSE,
+ publish_cloud_watch_metrics = FALSE,
+ bytes_scanned_cut_off = 10000000L,
+ description = NULL,
+ state = c("ENABLED", "DISABLED")
+)
Arguments
- conn
A dbConnect
object, as returned by dbConnect()
+
+
- work_group
The Athena workgroup name.
+
+
- enforce_work_group_config
If set to TRUE
, the settings for the workgroup override client-side settings.
If set to FALSE
, client-side settings are used. For more information, see
Workgroup Settings Override Client-Side Settings.
+
+
- publish_cloud_watch_metrics
Indicates that the Amazon CloudWatch metrics are enabled for the workgroup.
+
+
- bytes_scanned_cut_off
The upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.
+
+
- description
The workgroup description.
+
+
- tags
A tag that you can add to a resource. A tag is a label that you assign to an AWS Athena resource (a workgroup).
Each tag consists of a key and an optional value, both of which you define. Tags enable you to categorize workgroups in Athena, for example,
@@ -183,24 +195,37 @@
Arguments
The maximum tag key length is 128 Unicode characters in UTF-8. The maximum tag value length is 256 Unicode characters in UTF-8.
You can use letters and numbers representable in UTF-8, and the following characters: "+ - = . _ : / @"
. Tag keys and values are case-sensitive.
Tag keys must be unique per resource. Please use the helper function tag_options()
to create tags for work group, if no tags are required please put NULL
for this parameter.
+
+
- key
A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: "+ - = . _ : / @"
.
Tag keys are case-sensitive and must be unique per resource.
+
+
- value
A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: "+ - = . _ : / @"
.
Tag values are case-sensitive.
+
+
- recursive_delete_option
The option to delete the workgroup and its contents even if the workgroup contains any named queries
+
+
- remove_output_location
If set to TRUE
, indicates that the previously-specified query results location (also known as a client-side setting) for queries in this workgroup should be ignored and set to null.
If set to FALSE
the out put location in the workgroup's result configuration will be updated with the new value.
For more information, see Workgroup Settings Override Client-Side Settings.
+
+
- state
The workgroup state that will be updated for the given workgroup.
+
Value
-
- create_work_group
+
+
+- create_work_group
Returns NULL
but invisible
- tag_options
@@ -223,46 +248,46 @@ Value
Examples
-
if (FALSE) {
-# Note:
-# - Require AWS Account to run below example.
-# - Different connection methods can be used please see `noctua::dbConnect` documnentation
-
-library(noctua)
-
-# Demo connection to Athena using profile name
-con <- dbConnect(noctua::athena())
-
-# List current work group available
-list_work_groups(con)
-
-# Create a new work group
-wg <- create_work_group(con,
- "demo_work_group",
- description = "This is a demo work group",
- tags = tag_options(key= "demo_work_group", value = "demo_01"))
-
-# List work groups to see new work group
-list_work_groups(con)
-
-# get meta data from work group
-wg <- get_work_group(con, "demo_work_group")
-
-# Update work group
-wg <- update_work_group(con, "demo_work_group",
- description = "This is a demo work group update")
-
-
-# get updated meta data from work group
-wg <- get_work_group(con, "demo_work_group")
-
-# Delete work group
-delete_work_group(con, "demo_work_group")
-
-# Disconect from Athena
-dbDisconnect(con)
-}
-
+ if (FALSE) {
+# Note:
+# - Require AWS Account to run below example.
+# - Different connection methods can be used please see `noctua::dbConnect` documnentation
+
+library(noctua)
+
+# Demo connection to Athena using profile name
+con <- dbConnect(noctua::athena())
+
+# List current work group available
+list_work_groups(con)
+
+# Create a new work group
+wg <- create_work_group(con,
+ "demo_work_group",
+ description = "This is a demo work group",
+ tags = tag_options(key= "demo_work_group", value = "demo_01"))
+
+# List work groups to see new work group
+list_work_groups(con)
+
+# get meta data from work group
+wg <- get_work_group(con, "demo_work_group")
+
+# Update work group
+wg <- update_work_group(con, "demo_work_group",
+ description = "This is a demo work group update")
+
+
+# get updated meta data from work group
+wg <- get_work_group(con, "demo_work_group")
+
+# Delete work group
+delete_work_group(con, "demo_work_group")
+
+# Disconect from Athena
+dbDisconnect(con)
+}
+
@@ -277,7 +302,7 @@ Examples
diff --git a/man/db_compute.Rd b/man/db_compute.Rd
index 59aa316..9b70b5e 100644
--- a/man/db_compute.Rd
+++ b/man/db_compute.Rd
@@ -31,7 +31,7 @@ This is a backend function for dplyr's \code{compute} function. Users won't be r
\dontrun{
# Note:
# - Require AWS Account to run below example.
-# - Different connection methods can be used please see `noctua::dbConnect` documnentation
+# - Different connection methods can be used please see `noctua::dbConnect` documentation
library(DBI)
library(dplyr)