work_group {noctua} | R Documentation |
Athena Work Groups
Description
Lower level API access, allows user to create and delete Athena Work Groups.
- create_work_group
Creates a workgroup with the specified name (link). The work group utilises parameters from the
dbConnect
object, to determine the encryption and output location of the work group. The s3_staging_dir, encryption_option and kms_key parameters are gotten fromdbConnect
- tag_options
Helper function to create tag options for function
create_work_group()
- delete_work_group
Deletes the workgroup with the specified name (link). The primary workgroup cannot be deleted.
- list_work_groups
Lists available workgroups for the account (link).
- get_work_group
Returns information about the workgroup with the specified name (link).
- update_work_group
Updates the workgroup with the specified name (link). The workgroup's name cannot be changed. The work group utilises parameters from the
dbConnect
object, to determine the encryption and output location of the work group. The s3_staging_dir, encryption_option and kms_key parameters are gotten fromdbConnect
Usage
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 |
work_group |
The Athena workgroup name. |
enforce_work_group_config |
If set to |
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,
by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter workgroups in your account.
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: |
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: |
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: |
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 |
state |
The workgroup state that will be updated for the given workgroup. |
Value
- create_work_group
Returns
NULL
but invisible- tag_options
Returns
list
but invisible- delete_work_group
Returns
NULL
but invisible- list_work_groups
Returns list of available work groups
- get_work_group
Returns list of work group meta data
- update_work_group
Returns
NULL
but invisible
Examples
## Not run:
# 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)
## End(Not run)