Description Usage Arguments Note Examples
Long running Athena queries and Athena queries with large result
sets can seriously stall a dplyr
processing chain due to poorly
implemented ODBC and JDBC drivers. This function converts a dplyr
chain to a raw SQL query then submits it via start_query_execution()
and
returns the query execution id. You can retrieve the result set either
via get_query_resutls()
or your preferred way to retrieve data from S3.
1 2 3 4 |
obj |
the |
database |
database within which the query executes. |
output_location |
location in S3 where query results are stored. |
client_request_token |
unique case-sensitive string used to ensure the
request to create the query is idempotent (executes only once). If another
|
encryption_option |
indicates whether Amazon S3 server-side encryption
with Amazon S3-managed keys ( |
kms_key |
For |
aws_access_key_id |
AWS access key id |
aws_secret_access_key |
AWS secret access key |
aws_session_token |
AWS session token |
region_name |
region name |
profile_name |
profile name |
dbplyr
must be installed for this to work. It is not listed in
the Imports
as it brings with it many dependencies that may not
be necessary for general use of this package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## Not run:
library(odbc)
library(DBI)
DBI::dbConnect(
odbc::odbc(),
driver = "/Library/simba/athenaodbc/lib/libathenaodbc_sbu.dylib",
Schema = "sampledb",
AwsRegion = "us-east-1",
AwsProfile = "personal",
AuthenticationType = "IAM Profile",
S3OutputLocation = "s3://aws-athena-query-results-redacted"
) -> con
elb_logs <- tbl(con, "elb_logs")
mutate(elb_logs, tsday = substr(timestamp, 1, 10)) %>%
filter(tsday == "2014-09-29") %>%
select(requestip, requestprocessingtime) %>%
collect_async(
database = "sampledb",
output_location = "s3://aws-athena-query-results-redacted",
profile_name = "personal"
) -> id
get_query_execution(id, profile = "personal")
# do this to get the data or use your favorite way to grab files from S3
get_query_results(id, profile = "personal")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.