dbGetQuery: Send query, retrieve results and then clear result set

dbGetQueryR Documentation

Send query, retrieve results and then clear result set

Description

Send query, retrieve results and then clear result set

Usage

## S4 method for signature 'AthenaConnection,character'
dbGetQuery(conn, statement, statistics = FALSE, unload = athena_unload(), ...)

Arguments

conn

A DBIConnection object, as returned by dbConnect().

statement

a character string containing SQL.

statistics

If set to TRUE will print out AWS Athena statistics of query.

unload

boolean input to modify 'statement' to align with AWS Athena UNLOAD, default is set to FALSE.

...

Other parameters passed on to methods.

Value

dbGetQuery() returns a dataframe.

Note

If the user does not have permission to remove AWS S3 resource from AWS Athena output location, then an AWS warning will be returned. For example AccessDenied (HTTP 403). Access Denied. It is better use query caching or optionally prevent clear AWS S3 resource using RAthena_options so that the warning doesn't repeatedly show.

See Also

dbGetQuery

Examples

## Not run: 
# Note: 
# - Require AWS Account to run below example.
# - Different connection methods can be used please see `RAthena::dbConnect` documnentation

library(DBI)

# Demo connection to Athena using profile name 
con <- dbConnect(RAthena::athena())

# Sending Queries to Athena
dbGetQuery(con, "show databases")

# Disconnect conenction
dbDisconnect(con)

## End(Not run)

RAthena documentation built on May 20, 2022, 5:06 p.m.