| dbFetch,TrinoResult-method | R Documentation |
Pulls rows from the cursor, following Trino's nextUri chain as needed, and
converts each column to its R type according to the column's declared Trino
type and the connection's bigint setting.
## S4 method for signature 'TrinoResult'
dbFetch(res, n = -1, ...)
res |
A TrinoResult object. |
n |
Number of rows to fetch. |
... |
Unused, for compatibility with the generic. |
A tibble. Once the result is exhausted, a zero-row tibble with the right columns and types.
con <- DBI::dbConnect(RTrino::Trino(), host = Sys.getenv("RTRINO_TEST_URL"),
catalog = "tpch", schema = "tiny")
res <- DBI::dbSendQuery(con, "SELECT * FROM orders")
while (!DBI::dbHasCompleted(res)) {
chunk <- DBI::dbFetch(res, n = 4000)
# process chunk; here, just count its rows
cat(nrow(chunk), "rows\n")
}
DBI::dbClearResult(res)
DBI::dbDisconnect(con)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.