The dbSendQuery()
and dbSendStatement()
method submits a query to Athena but does not wait for query to execute.
dbHasCompleted
method will need to ran to check if query has been completed or not.
The dbExecute()
method submits a query to Athena and waits for the query to be executed.
# S4 method for AthenaConnection,character
dbSendQuery(conn, statement, unload = athena_unload(), ...)
# S4 method for AthenaConnection,character
dbSendStatement(conn, statement, unload = athena_unload(), ...)
# S4 method for AthenaConnection,character
dbExecute(conn, statement, unload = athena_unload(), ...)
A DBIConnection object, as returned by
dbConnect()
.
a character string containing SQL.
boolean input to modify `statement` to align with AWS Athena UNLOAD,
default is set to FALSE
.
Other parameters passed on to methods.
Returns AthenaResult
s4 class.
if (FALSE) {
# Note:
# - Require AWS Account to run below example.
# - Different connection methods can be used please see `noctua::dbConnect` documnentation
library(DBI)
# Demo connection to Athena using profile name
con <- dbConnect(noctua::athena())
# Sending Queries to Athena
res1 <- dbSendQuery(con, "show databases")
res2 <- dbSendStatement(con, "show databases")
res3 <- dbExecute(con, "show databases")
# Disconnect conenction
dbDisconnect(con)
}