Connection error while executing multiple queries on RMySQL

I execute the following block of code 8 times, but with different requests in three different R scripts. I have already established a connection to the server.

rs<-dbSendQuery(con,"select owner_name, owner_domain, count(*) as avg from kapsule, recview_history where recview_history.vsrc='em' and recview_history.g_conf_id=kapsule.g_conf_id group by owner_name;") d<-fetch(rs, n=0) d$test<-apply(d,1,function(row) 1) dp<-ddply(d, .(test), transform, percentile=ecdf(avg)(avg)) write.csv(dp, file="/tmp/creator_data/embeds.csv") rm(rs) rm(d) rm(dp) 

I run this on a very large dataset, and therefore, after the first two csv are created in each script, the script gives the following error.

 Error in mysqlExecStatement(conn, statement, ...) : RS-DBI driver: (connection with pending rows, close resultSet before continuing) 

when I ran three scripts earlier on a smaller dataset, they worked fine. Is the problem due to the large data size on the MySQL server? Any help in this regard would be duly appreciated. Thank you in advance.

+4
source share
1 answer

(Removing from Unanswered, indicating that the comments have permission.)

0
source

Source: https://habr.com/ru/post/1488631/


All Articles