monetdblite

Using monetdb_append from MonetdbLite C API

a 夏天 提交于 2020-03-05 05:19:43
问题 I am trying to use MonetDBLite C in an application. According to the PDF (https://arxiv.org/pdf/1805.08520.pdf), I would benefit from a boost in speed in loading massive amount of data using monetdb_append function. From PDF: In addition to issuing SQL queries, the embedded process can efficiently bulk append large amounts of data to the database using the monetdb_append function. This function takes the schema and the name of a table to append to, and a reference to the data to append to the

Mutate variables in database tables directly using dplyr

谁说我不能喝 提交于 2020-01-10 10:47:25
问题 Here is mtcars data in the MonetDBLite database file. library(MonetDBLite) library(tidyverse) library(DBI) dbdir <- getwd() con <- dbConnect(MonetDBLite::MonetDBLite(), dbdir) dbWriteTable(conn = con, name = "mtcars_1", value = mtcars) data_mt <- con %>% tbl("mtcars_1") I want to use dplyr mutate to create new variables and add (commit!) that to the database table? Something like data_mt %>% select(mpg, cyl) %>% mutate(var = mpg/cyl) %>% dbCommit(con) The desired output should be same when we

Create a connection to a DBMS in R

我的未来我决定 提交于 2019-12-24 12:23:36
问题 I'm using the libraries DBI to create a connection to a monetdblite database in R but I keep getting the same error. Here is the reproducible example and the error message I get. Any ideas on how to solve this ? # Load Packages library(MonetDB.R) library(MonetDBLite) library(survey) library(DBI) # Load Data data(api) # create survey design dclus1 <- svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc) # create Temp dir. dbfolder <- tempdir() # create connection db <- dbConnect(

Using tbl and src_monetdblite to access data

不打扰是莪最后的温柔 提交于 2019-12-11 15:56:51
问题 Sorry if this question has been asked elsewhere, I can't find it. I'm working through some basic examples in MonetDBLite. > dbGetQuery(dbcon, "SELECT MAX(mpg) FROM mtcars WHERE cyl = 8") L3 1 19.2 works, but > ms <- MonetDBLite::src_monetdblite("./DB") > t <- tbl(ms, "mtcars") Error in UseMethod("tbl") : no applicable method for 'tbl' applied to an object of class "c('src_monetdb', 'src_sql', 'src')" It seems that it's trying to assign the db to t not the table. Any suggestions would be