Changeset: 07489aec0ecc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=07489aec0ecc
Added Files:
        clients/R/Tests/All
        clients/R/Tests/dbi.R
        clients/R/Tests/dbi.stable.err
        clients/R/Tests/dbi.stable.out
        clients/R/Tests/dplyr.R
        clients/R/Tests/dplyr.stable.err
        clients/R/Tests/dplyr.stable.out
        clients/R/Tests/install-dependencies.sh
        clients/R/Tests/install.sh
        clients/R/Tests/install.stable.err
        clients/R/Tests/install.stable.out
        clients/R/Tests/survey.R
        clients/R/Tests/survey.stable.err
        clients/R/Tests/survey.stable.out
        sql/test/BugTracker-2014/Tests/number_4_4.Bug-3543.sql
        sql/test/BugTracker-2014/Tests/number_4_4.Bug-3543.stable.err
        sql/test/BugTracker-2014/Tests/number_4_4.Bug-3543.stable.out
        sql/test/BugTracker-2014/Tests/round.Bug-3542.sql
        sql/test/BugTracker-2014/Tests/round.Bug-3542.stable.err
        sql/test/BugTracker-2014/Tests/round.Bug-3542.stable.out
Removed Files:
        clients/R/db.tests/monetdb.test.R
        clients/R/db.tests/monetframe.test.R
        clients/R/db.tests/sqlsurvey.test.R
        clients/R/monet.frame/DESCRIPTION
        clients/R/monet.frame/NAMESPACE
        clients/R/monet.frame/NEWS
        clients/R/monet.frame/R/monetframe.R
        clients/R/monet.frame/man/aggregatef.Rd
        clients/R/monet.frame/man/as.data.frame.Rd
        clients/R/monet.frame/man/as.list.Rd
        clients/R/monet.frame/man/mf.Rd
        clients/R/monet.frame/man/monet.frame.Rd
        clients/R/monet.frame/man/sample.Rd
        clients/R/monet.frame/man/sd.Rd
        clients/R/monet.frame/man/set.debug.Rd
        clients/R/monet.frame/man/tabulate.Rd
        clients/R/monet.frame/man/tabulate.monet.frame.Rd
        clients/R/monet.frame/man/var.Rd
Modified Files:
        MonetDB.spec
        clients/R/MonetDB.R/R/monetdb.R
        clients/Tests/SQL-dump_all.stable.out
        clients/Tests/SQL-dump_all.stable.out.oid32
        clients/Tests/SQL-dump_geom.stable.out
        clients/Tests/SQL-dump_geom.stable.out.32bit
        clients/Tests/SQL-dump_geom.stable.out.64bit.oid32
        clients/Tests/SQL-dump_none.stable.out
        clients/Tests/exports.stable.out
        debian/control
        gdk/gdk.h
        gdk/gdk_atoms.c
        gdk/gdk_atoms.h
        gdk/gdk_bbp.c
        gdk/gdk_calc.c
        gdk/gdk_imprints.c
        gdk/gdk_imprints.h
        gdk/gdk_private.h
        gdk/gdk_select.c
        monetdb5/mal/mal_import.c
        monetdb5/modules/mal/tokenizer.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_round_impl.h
        sql/backends/monet5/sql_scenario.c
        sql/server/rel_optimizer.c
        sql/server/sql_decimal.c
        sql/server/sql_parser.y
        
sql/test/BugTracker-2013/Tests/bogus_aggregation_casts.Bug-3342.stable.out
        sql/test/BugTracker-2013/Tests/median.Bug-3352.stable.out
        sql/test/BugTracker-2014/Tests/All
        sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.sql
        sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.stable.out
        sql/test/Dump/Tests/dump.stable.out
        sql/test/quantiles/Tests/quantiles.stable.out
        sql/test/testdb/Tests/testdb-dump.stable.out
        testing/Mfilter.py.in
        testing/Mtest.py.in
Branch: default
Log Message:

Merge with Oct2014 branch.


diffs (truncated from 10018 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -98,7 +98,6 @@ BuildRequires: bzip2-devel
 %if %{?with_fits:1}%{!?with_fits:0}
 BuildRequires: cfitsio-devel
 %endif
-BuildRequires: flex
 %if %{?with_geos:1}%{!?with_geos:0}
 BuildRequires: geos-devel >= 3.0.0
 %endif
diff --git a/clients/R/MonetDB.R/R/monetdb.R b/clients/R/MonetDB.R/R/monetdb.R
--- a/clients/R/MonetDB.R/R/monetdb.R
+++ b/clients/R/MonetDB.R/R/monetdb.R
@@ -908,14 +908,14 @@ monet.read.csv <- monetdb.read.csv <- fu
   if(header || !missing(nrows)){
     if (length(nrows)==1) nrows <- rep(nrows, length(files))
     for(i in seq_along(files)) {
-      cat(files[i], thefile <- normalizePath(files[i]), "\n")
+      thefile <- normalizePath(files[i])
       dbSendUpdate(conn, paste("COPY", format(nrows[i], scientific=FALSE), 
"OFFSET 2 RECORDS INTO", 
                                tablename, "FROM", paste("'", thefile, "'", 
sep=""), delimspec, "NULL as", paste("'", 
                                                                                
                                 na.strings[1], "'", sep=""), if(locked) 
"LOCKED"))
     }
   } else {
     for(i in seq_along(files)) {
-      cat(files[i], thefile <- normalizePath(files[i]), "\n")
+      thefile <- normalizePath(files[i])
       dbSendUpdate(conn, paste0("COPY INTO ", tablename, " FROM ", paste("'", 
thefile, "'", sep=""), 
                                 delimspec, "NULL as ", paste("'", 
na.strings[1], "'", sep=""), if(locked) " LOCKED "))
     }
diff --git a/clients/R/Tests/All b/clients/R/Tests/All
new file mode 100644
--- /dev/null
+++ b/clients/R/Tests/All
@@ -0,0 +1,6 @@
+HAVE_LIBR?install
+HAVE_LIBR?dbi
+HAVE_LIBR?survey
+HAVE_LIBR?dplyr
+
+
diff --git a/clients/R/Tests/dbi.R b/clients/R/Tests/dbi.R
new file mode 100644
--- /dev/null
+++ b/clients/R/Tests/dbi.R
@@ -0,0 +1,143 @@
+library(MonetDB.R,quietly=T)
+
+args <- commandArgs(trailingOnly = TRUE)
+dbport <- 50000
+dbname <- "mTests_clients_R"
+if (length(args) > 0) 
+       dbport <- args[[1]]
+
+options(monetdb.insert.splitsize=10)
+
+drv <- dbDriver("MonetDB")
+stopifnot(identical(dbGetInfo(drv)$name,"MonetDBDriver"))
+
+con <- dbConnect(drv, port=dbport, dbname=dbname)
+stopifnot(identical(class(con)[[1]],"MonetDBConnection"))
+# overwrite variable to force destructor
+con <- mc(port=dbport, dbname=dbname)
+con <- mc(port=dbport, dbname=dbname)
+sink(tempfile()) # redirect gc output not to confuse Mtest
+gc()
+sink()
+
+# basic MAPI/SQL test
+stopifnot(identical(dbGetQuery(con,"SELECT 'DPFKG!'")[[1]],"DPFKG!"))
+
+# remove test table
+if (dbExistsTable(con,"monetdbtest")) dbRemoveTable(con,"monetdbtest")
+stopifnot(identical(dbExistsTable(con,"monetdbtest"),FALSE))
+
+
+# test raw handling
+dbSendUpdate(con,"CREATE TABLE monetdbtest (a varchar(10),b integer,c blob)")
+stopifnot(identical(dbExistsTable(con,"monetdbtest"),TRUE))
+dbSendUpdate(con,"INSERT INTO monetdbtest VALUES ('one',1,'1111')")
+dbSendUpdate(con,"INSERT INTO monetdbtest VALUES ('two',2,'22222222')")
+stopifnot(identical(dbGetQuery(con,"SELECT count(*) FROM monetdbtest")[[1]],2))
+stopifnot(identical(dbReadTable(con,"monetdbtest")[[3]],list(charToRaw("1111"),charToRaw("22222222"))))
+stopifnot(identical(as.character(dbListTables(con)),"monetdbtest"))
+
+dbRemoveTable(con,"monetdbtest")
+stopifnot(identical(dbExistsTable(con,"monetdbtest"),FALSE))
+
+# write test table iris
+data(iris)
+dbWriteTable(con,"monetdbtest",iris)
+
+stopifnot(identical(dbExistsTable(con,"monetdbtest"),TRUE))
+stopifnot(identical(dbExistsTable(con,"monetd
+       btest2"),FALSE))
+stopifnot("monetdbtest" %in% dbListTables(con))
+
+stopifnot(identical(dbListFields(con,"monetdbtest"),c("sepal_length","sepal_width","petal_length","petal_width","species")))
+# get stuff, first very convenient
+iris2 <- dbReadTable(con,"monetdbtest")
+stopifnot(identical(dim(iris),dim(iris2)))
+
+
+# then manually
+res <- dbSendQuery(con,"SELECT species, sepal_width FROM monetdbtest")
+stopifnot(identical(class(res)[[1]],"MonetDBResult"))
+stopifnot(identical(res@env$success,TRUE))
+
+stopifnot(dbColumnInfo(res)[[1,1]] == "species")
+stopifnot(dbColumnInfo(res)[[2,1]] == "sepal_width")
+
+stopifnot(dbGetInfo(res)$row.count == 150 && res@env$info$rows == 150)
+
+data <- fetch(res,10)
+stopifnot(dim(data)[[1]] == 10)
+stopifnot(dim(data)[[2]] == 2)
+stopifnot(res@env$delivered == 10)
+stopifnot(dbHasCompleted(res) == FALSE)
+
+data2 <- fetch(res,-1)
+stopifnot(dim(data2)[[1]] == 140)
+stopifnot(dbHasCompleted(res) == TRUE)
+
+dbClearResult(res)
+
+# remove table again
+dbRemoveTable(con,"monetdbtest")
+stopifnot(identical(dbExistsTable(con,"monetdbtest"),FALSE))
+
+# test csv import
+file <- tempfile()
+write.table(iris,file,sep=",")
+monetdb.read.csv(con,file,"monetdbtest",150)
+unlink(file)
+stopifnot(identical(dbExistsTable(con,"monetdbtest"),TRUE))
+iris3 <- dbReadTable(con,"monetdbtest")
+stopifnot(identical(dim(iris),dim(iris3)))
+stopifnot(identical(dbListFields(con,"monetdbtest"),c("sepal_length","sepal_width","petal_length","petal_width","species")))
+dbRemoveTable(con,"monetdbtest")
+stopifnot(identical(dbExistsTable(con,"monetdbtest"),FALSE))
+# test dbWriteTable
+conn <- con
+tname <- "mtcars"
+
+tsize <- function(conn,tname) 
+       as.integer(dbGetQuery(conn,paste0("SELECT COUNT(*) FROM ",tname))[[1]])
+
+# clean up
+if (dbExistsTable(conn,tname))
+       dbRemoveTable(conn,tname)
+
+# table does not exist, append=F, overwrite=F, this should work
+dbWriteTable(conn,tname,mtcars,append=F,overwrite=F)
+stopifnot(dbExistsTable(conn,tname))
+stopifnot(identical(nrow(mtcars),tsize(conn,tname)))
+
+# these should throw errors
+errorThrown <- F
+tryCatch(dbWriteTable(conn,tname,mtcars,append=F,overwrite=F),error=function(e){errorThrown
 <<- T})
+stopifnot(errorThrown)
+
+errorThrown <- F
+tryCatch(dbWriteTable(conn,tname,mtcars,overwrite=T,append=T),error=function(e){errorThrown
 <<- T})
+stopifnot(errorThrown)
+
+# this should be fine
+dbWriteTable(conn,tname,mtcars,append=F,overwrite=T)
+stopifnot(dbExistsTable(conn,tname))
+stopifnot(identical(nrow(mtcars),tsize(conn,tname)))
+
+# append to existing table
+dbWriteTable(conn,tname,mtcars,append=T,overwrite=F)
+stopifnot(identical(as.integer(2*nrow(mtcars)),tsize(conn,tname)))
+dbRemoveTable(conn,tname)
+
+dbRemoveTable(conn,tname)
+dbWriteTable(conn,tname,mtcars,append=F,overwrite=F,insert=T)
+dbRemoveTable(conn,tname)
+
+#thrice to catch null pointer errors
+stopifnot(identical(dbDisconnect(con),TRUE))
+stopifnot(identical(dbDisconnect(con),TRUE))
+stopifnot(identical(dbDisconnect(con),TRUE))
+
+#test merovingian control code
+#cannot really do this in Mtest, sorry
+#stopifnot(dbname %in% monetdbd.liststatus("monetdb")$dbname)
+
+print("SUCCESS")
diff --git a/clients/R/Tests/dbi.stable.err b/clients/R/Tests/dbi.stable.err
new file mode 100644
--- /dev/null
+++ b/clients/R/Tests/dbi.stable.err
@@ -0,0 +1,37 @@
+stderr of test 'dbi` in directory 'clients/R` itself:
+
+
+# 14:24:02 >  
+# 14:24:02 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=37882" "--set" 
"mapi_usock=/var/tmp/mtest-79204/.s.monetdb.37882" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/Users/hannes/monetdb-oct2014-install/var/MonetDB/mTests_clients_R" 
"--set" "mal_listing=0" "--set" "embedded_r=yes"
+# 14:24:02 >  
+
+# builtin opt  gdk_dbpath = 
/Users/hannes/monetdb-oct2014-install/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 37882
+# cmdline opt  mapi_usock = /var/tmp/mtest-79204/.s.monetdb.37882
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/Users/hannes/monetdb-oct2014-install/var/MonetDB/mTests_clients_R
+# cmdline opt  mal_listing = 0
+# cmdline opt  embedded_r = yes
+# cmdline opt  gdk_debug = 536870922
+
+# 14:24:03 >  
+# 14:24:03 >  "R" "--vanilla" "--slave" "--args" "37882"
+# 14:24:03 >  
+
+
+# 14:24:04 >  
+# 14:24:04 >  "Done."
+# 14:24:04 >  
+
diff --git a/clients/R/Tests/dbi.stable.out b/clients/R/Tests/dbi.stable.out
new file mode 100644
--- /dev/null
+++ b/clients/R/Tests/dbi.stable.out
@@ -0,0 +1,72 @@
+stdout of test 'dbi` in directory 'clients/R` itself:
+
+
+# 14:24:02 >  
+# 14:24:02 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=37882" "--set" 
"mapi_usock=/var/tmp/mtest-79204/.s.monetdb.37882" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/Users/hannes/monetdb-oct2014-install/var/MonetDB/mTests_clients_R" 
"--set" "mal_listing=0" "--set" "embedded_r=yes"
+# 14:24:02 >  
+
+# MonetDB 5 server v11.19.0
+# This is an unreleased version
+# Serving database 'mTests_clients_R', using 8 threads
+# Compiled for x86_64-apple-darwin14.0.0/64bit with 64bit OIDs dynamically 
linked
+# Found 16.000 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://wired1-11.cwi.nl:37882/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-79204/.s.monetdb.37882
+# MonetDB/SQL module loaded
+# MonetDB/R   module loaded
+
+Ready.
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_querylog.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 19_cluster.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_functions.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 24_zorder.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 26_sysmon.sql
+# loading sql script: 39_analytics.sql
+# loading sql script: 40_json.sql
+# loading sql script: 41_jsonstore.sql
+# loading sql script: 45_uuid.sql
+# loading sql script: 75_storagemodel.sql
+# loading sql script: 80_statistics.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 90_generator.sql
+# loading sql script: 99_system.sql
+
+# 14:24:03 >  
+# 14:24:03 >  "R" "--vanilla" "--slave" "--args" "37882"
+# 14:24:03 >  
+
+[1] TRUE
+[1] TRUE
+[1] TRUE
+[1] TRUE
+   L1
+1 150
+[1] TRUE
+[1] TRUE
+[1] TRUE
+[1] TRUE
+[1] TRUE
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to