dbFetch: Fetch records from previously executed query

Description Usage Arguments Value See Also Examples

Description

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

Usage

1
2
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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 Nov. 26, 2021, 5:19 p.m.