A function to pull a large data table from SQL Server to R in parallel chunks This function relies on the parallel package which uses a fork / exec mechanism. Therefore, it is important that the parent process not have an initialized JVM if using rJDBC for database connectivity, as the child processes will see it and attempt to use it.
1 2 | dbGetQueryParallel(dbConnectionFun, dbConnectionArgs, tableName,
orderByClause, nThreads = 8)
|
dbConnectionFun |
The function to be called to instantiate a database connection |
dbConnectionArgs |
The values of the parameters (in a named list) to be passed to dbConnectionFun to instantiate a connection |
tableName |
The name of the table to be pulled from the database |
orderByClause |
The ORDER BY clause that will be used to determine the order in which rows are fetched. This MUST define a total ordering on the rows of the table, or the behavior of the FETCH operation will not be predictable. |
nThreads |
The number of parallel jobs to be used to fetch the table |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.