Learn R Programming

RAthena (version 2.6.1)

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

Description

Send query, retrieve results and then clear result set

Usage

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

Value

dbGetQuery() returns a dataframe.

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.

See Also

Examples

Run this code
if (FALSE) {
# 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)
}

Run the code above in your browser using DataLab