collect_with_parallelism: Collect a lazy table with specified degree of parallelism

View source: R/collect_with_parallelism.R

collect_with_parallelismR Documentation

Collect a lazy table with specified degree of parallelism

Description

Execute and collect dbplyr lazy table with specified degree of parallelism. Adds a parallel hint to all SELECT statements: ⁠SELECT /* +PARALLEL(N) */...⁠ The hint is usually taken into account, but as it is only a hint, the database optimizer ultimately makes a final decision as to which degree of parallelism to use, if any. This is based on things like the query itself and the amount of concurrent use. To override the optimizer and force a specific degree, the session needs to be altered: ⁠alter session enable parallel query; alter session force parallel query parallel n;⁠ (not supported here).

Usage

collect_with_parallelism(lazy_tbl, n)

Arguments

lazy_tbl

A dbplyr lazy table.

n

Degree of parallelism.

Value

Returns a local data frame.

Examples

## Not run: 
df <- collect_with_parallelism(df_lazy, 12)

## End(Not run)

nhsbsa-data-analytics/nhsbsaR documentation built on Jan. 25, 2025, 8:54 a.m.