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. Currently chunk sizes range from 0 to 999, 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 `RAthena::dbConnect` documnentation

library(DBI)

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

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

# Disconnect from Athena
dbDisconnect(con)

## End(Not run)

RAthena documentation built on Dec. 28, 2022, 1:19 a.m.