dbFetch: Fetch records from previously executed query

dbFetchR Documentation

Fetch records from previously executed query

Description

Currently returns the top n elements (rows) from result set or returns entire table from Athena.

Usage

## S4 method for signature 'AthenaResult'
dbFetch(res, n = -1, ...)

Arguments

res

An object inheriting from DBIResult, created by dbSendQuery().

n

maximum number of records to retrieve per fetch. Use n = -1 or n = Inf to retrieve all pending records. Some implementations may recognize other special values. If entire dataframe is required use n = -1 or n = Inf.

...

Other arguments passed on to methods.

Value

dbFetch() returns a data frame.

See Also

dbFetch

Examples

## Not run: 
# 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())

res <- dbSendQuery(con, "show databases")
dbFetch(res)
dbClearResult(res)

# Disconnect from Athena
dbDisconnect(con)

## End(Not run)

noctua documentation built on Aug. 9, 2023, 1:07 a.m.