Skip to content

Commit cd16847

Browse files
committed
Deploying to gh-pages from @ 4b1f8b9 🚀
1 parent 1eb7569 commit cd16847

8 files changed

Lines changed: 82 additions & 4 deletions

File tree

articles/data-ingestion-from-sql.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

articles/data-ingestion-from-sql.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ print method, the [tibble](https://cran.r-project.org/package=tibble)
3939
package offers an alternative):
4040

4141
``` r
42+
4243
library(RPostgreSQL)
4344
library(data.table)
4445
library(tiledb)
@@ -57,6 +58,7 @@ backend, this can be as simple as
5758
(and likely transient) database.
5859

5960
``` r
61+
6062
## a local SQL db we have here -- about 617k rows
6163
dbSetup <- function() {
6264
drv <- dbDriver("PostgreSQL")
@@ -76,6 +78,7 @@ In the next step we fetch the data—and for simplicity issue just one
7678
could easily bucket by symbols, or date range, or …
7779

7880
``` r
81+
7982
getDataFromSQL <- function() {
8083
con <- dbSetup()
8184
sql <- "select * from stockprices order by symbol, date;"
@@ -96,6 +99,7 @@ being text, do not set a domain set. For the date we set two ‘safe’
9699
outer values for the range.
97100

98101
``` r
102+
99103
storeDataTDB <- function(dat, uri) {
100104
fromDataFrame(dat, uri,
101105
col_index=1:2,
@@ -115,6 +119,7 @@ dimension values, or attributes. Here, for simplicity, we just read
115119
everything.
116120

117121
``` r
122+
118123
getDataTDB <- function(uri) {
119124
set_allocation_size_preference(1e7) # larger than local default value
120125
arr <- tiledb_array(uri, return_as="data.frame")

0 commit comments

Comments
 (0)