hannes / MonetDBLite

MonetDB reconfigured as a library
108 stars 11 forks source link

dplyr::compute() function not working with MonetDB server driver #186

Open palmaresk8 opened 7 years ago

palmaresk8 commented 7 years ago

I want to create a table (permanent or not) as a result of some data manipulation without transfering data to R (only keeping data in MonetDB server), but the compute() function is not working when I use the MonetDB.R() driver, although It works with the MonetDBLite() driver.

Reproducible: Always Steps to Reproduce:

library(MonetDBLite)
library(DBI)
library(dplyr)

# Connect to the database
conn <- dbConnect(
  MonetDB.R(),
  host = "localhost",
  dbname = "ipea",
  user = "monetdb",
  password = "monetdb",
  timeout = 86400L
)

# Create a table
dbWriteTable(conn, "mtcars", mtcars)
dbListTables(conn)

# Connect to the table
x <- tbl(conn, "mtcars")
View(x)

# Manipulate data
y <- x %>% filter(gear==4)
View(y)

# Compute
z <- compute(y)
dbListTables(conn)
View(z)

# Disconnect from database
dbDisconnect(conn)

Actual Results: empty table Expected Results: table with manipulate data.

Note that the same code above works well if I use a MonetDBLite connection driver:

conn <- dbConnect( MonetDBLite(), "C:/MonetDBdata/ipea" )

hannes commented 7 years ago

Yes this is indeed an issue with standalone MonetDB.