Description Usage Arguments Details Value References Examples
This funciton combines the start_query_execution
with the
save_query_results
function to execute, run, and retrieve
the results of a SQL query on Athena.
1 2 3 4 5 6 | execute_and_save_query(query, database, output_location, local_filename,
client_request_token = NULL, encryption_option = NULL,
kms_key = NULL, aws_access_key_id = NULL,
aws_secret_access_key = NULL, aws_session_token = NULL,
region_name = NULL, profile_name = NULL, polling_duration = 15,
checktime = FALSE, maxtime = 1000)
|
query |
SQL query statements to be executed |
database |
database within which the query executes. |
output_location |
location in S3 where query results are stored. |
local_filename |
download location of the athena result |
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 |
polling_duration |
how often to check for results |
checktime |
whether to check for time |
profile |
profile name |
max_time |
how long to keep looking for data |
This is useful for downloading large results where it is undesireable to load the full dataset into memory.
the filename
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
execute_and_save_query(
query = "SELECT * FROM elb_logs LIMIT 100",
database = "sampledb",
profile = "personal",
output_location = "s3://aws-athena-query-results-redacted",
local_filename = "download-to-here.csv",
polling_duration = 15,
checktime=FALSE,
maxtime=1000
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.