简体   繁体   English

无法使用dplyr访问现有的MonetDB

[英]Can't access existing MonetDB with dplyr

I created a MonetDBLite database yesterday, populated it, and was accessing it with dplyr , however this morning I don't seem able to use dplyr . 我昨天创建了一个MonetDBLite数据库,填充它,并使用dplyr访问它,但是今天早上我似乎无法使用dplyr

Here's my connection: 这是我的联系:

statcast_db <- MonetDBLite::src_monetdblite("/Users/williampetti/statcast_database/statcast_db_Monet", create = FALSE)

And here's a simple query for the statcast_17 table: 这是statcast_17表的简单查询:

statcast_db %>% 
    tbl("statcast_17") %>% 
    select(game_date) %>% 
    distinct() %>% 
    collect() %>% 
    tail(n = 1)

Yesterday, this worked fine. 昨天,这很好。 This morning, I get this error: 今天早上,我收到此错误:

Error in UseMethod("db_query_fields") : 
  no applicable method for 'db_query_fields' applied to an object of class "MonetDBEmbeddedConnection"

If I use a simple dbGetQuery call, however, it works fine: 但是,如果我使用简单的dbGetQuery调用,它可以正常工作:

> dbGetQuery(statcast_db$con, "SELECT game_date FROM statcast_17 ORDER BY game_date DESC LIMIT 1")
   game_date
1 2017-04-29

Here's my session info: 这是我的会话信息:

> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] xml2_1.1.1        baseballr_0.3.1   RSQLite_1.0.0     pacman_0.4.1     
 [5] dplyr_0.5.0       purrr_0.2.2       readr_1.0.0       tidyr_0.6.0      
 [9] tibble_1.2        ggplot2_2.2.1     tidyverse_1.0.0   magrittr_1.5     
[13] MonetDBLite_0.3.1 RMySQL_0.10.9     DBI_0.5-1        

loaded via a namespace (and not attached):
 [1] splines_3.3.1       lattice_0.20-33     colorspace_1.2-6   
 [4] htmltools_0.3.5     mgcv_1.8-12         chron_2.3-47       
 [7] XML_3.98-1.6        survival_2.40-1     hexbin_1.27.1      
[10] foreign_0.8-66      RColorBrewer_1.1-2  plyr_1.8.4         
[13] stringr_1.2.0       munsell_0.4.3       gtable_0.2.0       
[16] rvest_0.3.2         XML2R_0.0.6         codetools_0.2-14   
[19] latticeExtra_0.6-28 knitr_1.14          reldist_1.6-6      
[22] htmlTable_1.7       Rcpp_0.12.9         acepack_1.4.1      
[25] scales_0.4.1        pitchRx_1.8.2       Hmisc_4.0-0        
[28] gridExtra_2.2.1     digest_0.6.11       stringi_1.1.3      
[31] grid_3.3.1          tools_3.3.1         bitops_1.0-6       
[34] lazyeval_0.2.0      RCurl_1.95-4.8      Formula_1.2-1      
[37] cluster_2.0.4       MASS_7.3-45         Matrix_1.2-6       
[40] data.table_1.9.6    lubridate_1.6.0     httr_1.2.1         
[43] assertthat_0.1      R6_2.1.3            rpart_4.1-10       
[46] nnet_7.3-12         nlme_3.1-128   

I just replied to a similar question this morning after figuring out that the order in which you load MonetDBLite matters. 在确定加载MonetDBLite的顺序MonetDBLite重要之后,我今天早上回答了类似的问题。 I came across this question trying to figure out why it does matter. 我遇到了这个问题,想弄清楚它为什么重要。 I was having the same type of Error in UseMethod problems as BillPetti. Error in UseMethod遇到与UseMethod问题相同类型的Error in UseMethod Making sure MonetDBLite loads after dplyr and dbplyr has resolved the issue for me. 确保MonetDBLite加载后dplyrdbplyr已经解决了这个问题对我来说。 Here's the link to that other answer: 这是其他答案的链接:

https://stackoverflow.com/a/53307673/3705612 https://stackoverflow.com/a/53307673/3705612

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM