[Monetr-users] r87 - in pkg/MonetDB.R: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 23 14:24:27 CEST 2013


Author: hannes
Date: 2013-07-23 14:24:27 +0200 (Tue, 23 Jul 2013)
New Revision: 87

Modified:
   pkg/MonetDB.R/DESCRIPTION
   pkg/MonetDB.R/NEWS
   pkg/MonetDB.R/R/monetdb.R
Log:
another fetch() bugfix

Modified: pkg/MonetDB.R/DESCRIPTION
===================================================================
--- pkg/MonetDB.R/DESCRIPTION	2013-07-23 08:06:42 UTC (rev 86)
+++ pkg/MonetDB.R/DESCRIPTION	2013-07-23 12:24:27 UTC (rev 87)
@@ -1,5 +1,5 @@
 Package: MonetDB.R
-Version: 0.7.4
+Version: 0.7.5
 Date: 2013-07-23
 Title: Connect MonetDB to R
 Authors at R: c(person("Hannes Muehleisen", "Developer", role = c("aut", "cre"),email = "hannes at cwi.nl"),

Modified: pkg/MonetDB.R/NEWS
===================================================================
--- pkg/MonetDB.R/NEWS	2013-07-23 08:06:42 UTC (rev 86)
+++ pkg/MonetDB.R/NEWS	2013-07-23 12:24:27 UTC (rev 87)
@@ -1,3 +1,6 @@
+0.7.5
+- more fetch() fixes
+
 0.7.4
 - string to line splitting to c, NA handling to C as well
 

Modified: pkg/MonetDB.R/R/monetdb.R
===================================================================
--- pkg/MonetDB.R/R/monetdb.R	2013-07-23 08:06:42 UTC (rev 86)
+++ pkg/MonetDB.R/R/monetdb.R	2013-07-23 12:24:27 UTC (rev 87)
@@ -382,8 +382,8 @@
   }
   
   # now, if our tuple cache in res at env$data does not contain n rows, we have to fetch from server until it does
-  while (length(res at env$data) < n) {
-    cresp <- .mapiParseResponse(.mapiRequest(res at env$conn,paste0("Xexport ",.mapiLongInt(info$id)," ", .mapiLongInt(info$index), " ", .mapiLongInt(max(n,PREFERRED_FETCH_SIZE)))))
+  if (length(res at env$data) < n) {
+    cresp <- .mapiParseResponse(.mapiRequest(res at env$conn,paste0("Xexport ",.mapiLongInt(info$id)," ", .mapiLongInt(info$index), " ", .mapiLongInt(n-length(res at env$data)))))
 	stopifnot(cresp$type == Q_BLOCK && cresp$rows > 0)
 	
 	res at env$data <- c(res at env$data,cresp$tuples)
@@ -473,8 +473,6 @@
 PROTOCOL_v9 <- 9
 MAX_PACKET_SIZE <- 8192 # determined by fair guessing, haha
 
-PREFERRED_FETCH_SIZE <- 100
-
 HASH_ALGOS <- c("md5", "sha1", "crc32", "sha256","sha512")
 
 MSG_REDIRECT <- "^"
@@ -652,9 +650,7 @@
       env$types	<- env$dbtypes <- toupper(.mapiParseTableHeader(lines[4]))
       env$lengths	<- .mapiParseTableHeader(lines[5])
 
-	env$tuples <-lines[6:length(lines)]
-			
-			  
+	  env$tuples <-lines[6:length(lines)]
       
       return(env)
     }
@@ -668,10 +664,8 @@
       env$rows	<- header$rows
       env$cols	<- header$cols
       env$index	<- header$index
-		env$tuples <- lines[2:length(lines)]
-		
-			  
-      
+	  env$tuples <- lines[2:length(lines)]
+
       return(env)
     }
     



More information about the Monetr-users mailing list