Closed RCura closed 7 years ago
Hi, Trying to understand the issue #181 , I came to realise that it seems that a lot of MonetDBLite's dplyr.R code seems to be non working.
dplyr.R
For example, there's a custom sample_n() function defined, but it gives this error message :
sample_n()
> # Create example dataset > rep_data <- tibble(val = runif(n = 1E6), grp = if_else(val < .5, "A", "B")) > # Copy this dataset to MonetDBLite > con <- dbConnect(MonetDBLite::MonetDBLite(), "testData") > dbWriteTable(conn = con, rep_data, name = "rep_data", overwrite = TRUE) > > # Query this base > thisTable <- tbl(src = con, "rep_data") > thisTable %>% group_by(grp) %>% sample_n(size = 10) %>% show_query() Error: `tbl` must be a data frame, not tbl_dbi/tbl_sql/tbl_lazy/tbl
I naively tried to add the tbl_monetdb class to this object (as dplyr.R code seems to rely on such object), but the problem remains :
tbl_monetdb
> thisTable <- tbl(src = con, "rep_data") > class(thisTable) <- c(class(thisTable), "tbl_monetdb") > class(thisTable) [1] "tbl_dbi" "tbl_sql" "tbl_lazy" "tbl" "tbl_monetdb" > thisTable %>% group_by(grp) %>% sample_n(size = 10) %>% show_query() Error: `tbl` must be a data frame, not tbl_dbi/tbl_sql/tbl_lazy/tbl/tbl_monetdb
Indeed sample_n is broken. My apologies. We had no test case for this, so it slipped through.
This should also be working again
Hi, Trying to understand the issue #181 , I came to realise that it seems that a lot of MonetDBLite's
dplyr.R
code seems to be non working.For example, there's a custom
sample_n()
function defined, but it gives this error message :I naively tried to add the
tbl_monetdb
class to this object (asdplyr.R
code seems to rely on such object), but the problem remains :