I am trying to connect to a monetdblite databases, which worked fine minutes ago. After closing the connection in another session, reopening R, I am getting this error msg:
con <- dbConnect(MonetDBLite(), path_db)
Error in MonetDBLite::monetdb_embedded_startup(embedded, !getOption("monetdb.debug.embedded", :
Failed to initialize embedded MonetDB !FATAL: BBPinit: "free" value larger than "size" in heap of bat 9
If I try it again I get:
Error in MonetDBLite::monetdb_embedded_startup(embedded, !getOption("monetdb.debug.embedded", :
Failed to initialize embedded MonetDB !FATAL: BBPaddfarm: bad rolemask
I tried this out in R and RStudio.
Edit: Thanks for the reply (and the MonetDbLite package, btw). This error occured after I finshed creating a database; I put in some data, (around 2.7e9 rows) and disconnected successfully from the database (that is i used dbDisconnect(con) and got TRUE as results, which is why I assumed something else was wrong). R version is 3.2.2, server is a windows server 2012 R2.
Edit2 -> minimal reproducible example:
####### Example
library(data.table)
library(MonetDB.R)
data_orig <- data.table(id=rep(1:1e3,each=sample(100,1)))
data_orig[,y:=rnorm(.N)][,t:=1:.N,by=id]
lu <- data.table(t=1:max(data_orig[["t"]]))
dbdir <- tempdir()
con <- dbConnect(MonetDB.R::MonetDB(), embedded = dbdir)
# Create data
dbWriteTable(con,"data_orig",data_orig)
for(i in data_orig[,unique(id)]){
print(i)
query <- paste0("select * from data_orig where id=",i)
data_i <- dbGetQuery(con,query)
setDT(data_i)
tmp <- data_i[lu,roll=T,on="t"]
dbWriteTable(con,"data_new",tmp,append=T)
}
dbDisconnect(con)
Basically i read data from the database, aggregate it, and put it back again.