Changeset: 8ae7e8d75229 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8ae7e8d75229
Modified Files:
clients/R/MonetDB.R/src/mapi.c
clients/R/Tests/dplyr.R
clients/R/Tests/dplyr.stable.err
clients/R/Tests/dplyr.stable.out
debian/monetdb5-sql.init.d
gdk/gdk_bbp.c
monetdb5/mal/mal_type.h
monetdb5/modules/mal/Tests/manifold.mal
monetdb5/modules/mal/Tests/manifold.stable.out
monetdb5/modules/mal/Tests/manifoldstr.mal
monetdb5/modules/mal/Tests/manifoldstr.stable.out
monetdb5/modules/mal/remote.c
monetdb5/optimizer/opt_aliases.h
monetdb5/optimizer/opt_commonTerms.h
monetdb5/optimizer/opt_constants.h
monetdb5/optimizer/opt_costModel.h
monetdb5/optimizer/opt_dataflow.h
monetdb5/optimizer/opt_deadcode.h
monetdb5/optimizer/opt_emptySet.h
monetdb5/optimizer/opt_evaluate.h
monetdb5/optimizer/opt_factorize.h
monetdb5/optimizer/opt_garbageCollector.h
monetdb5/optimizer/opt_generator.h
monetdb5/optimizer/opt_inline.h
monetdb5/optimizer/opt_json.h
monetdb5/optimizer/opt_macro.h
monetdb5/optimizer/opt_matpack.h
monetdb5/optimizer/opt_mergetable.h
monetdb5/optimizer/opt_octopus.c
monetdb5/optimizer/opt_octopus.h
monetdb5/optimizer/opt_pushranges.h
monetdb5/optimizer/opt_qep.h
monetdb5/optimizer/opt_recycler.h
sql/backends/monet5/datacell/opt_datacell.h
sql/benchmarks/tpch/Tests/01-explain.stable.out.32bit
sql/benchmarks/tpch/Tests/04-explain.stable.out.32bit
sql/benchmarks/tpch/Tests/13-explain.stable.out.32bit
sql/benchmarks/tpch/Tests/16-explain.stable.out.32bit
sql/benchmarks/tpch/Tests/20-explain.stable.out.32bit
sql/benchmarks/tpch/Tests/21-explain.stable.out.32bit
sql/benchmarks/tpch/Tests/22-explain.stable.out.32bit
Branch: default
Log Message:
Merge with Oct2014 branch.
diffs (truncated from 2362 to 300 lines):
diff --git a/clients/R/MonetDB.R/src/mapi.c b/clients/R/MonetDB.R/src/mapi.c
--- a/clients/R/MonetDB.R/src/mapi.c
+++ b/clients/R/MonetDB.R/src/mapi.c
@@ -35,6 +35,11 @@
#include <fcntl.h>
#include <errno.h>
+#ifndef SOCKET_ERROR
+#define INVALID_SOCKET -1
+#define SOCKET_ERROR -1
+#endif
+
// R headers
#include <R.h>
#include <Rdefines.h>
diff --git a/clients/R/Tests/dplyr.R b/clients/R/Tests/dplyr.R
--- a/clients/R/Tests/dplyr.R
+++ b/clients/R/Tests/dplyr.R
@@ -2,6 +2,12 @@ ll <- NULL
if (Sys.getenv("TSTTRGDIR") != "") {
ll <- paste0(Sys.getenv("TSTTRGDIR"),"/rlibdir")
}
+ff <- textConnection("asdf", open="w")
+# hide output from connect and attach since it would blow up the test output
+# dangerous since it might hide useful warnings
+# so if things go south it might be a good idea to uncomment the cat(dd) below
+dd <- capture.output( suppressMessages ( {
+
library(MonetDB.R,quietly=T,lib.loc=ll)
library(dplyr,quietly=T)
library(Lahman,quietly=T)
@@ -12,6 +18,7 @@ dbname <- "mTests_clients_R"
if (length(args) > 0)
dbport <- args[[1]]
+
# old way
if (exists("lahman_monetdb")) {
# overwrite all args because lahman_monetdb sets a default arg in the
first pos.
@@ -19,18 +26,22 @@ if (exists("lahman_monetdb")) {
user="monetdb",password="monetdb",timeout=100,wait=T,language="sql")
# new way
} else {
- dps <- src_monetdb(dbname=dbname, port=dbport)
+ dps <- src_monetdb(dbname=dbname, port=dbport)
copy_lahman(dps)
}
+}))
+
+#cat(dd)
# the remainder is pretty much the example from the manpage.
-
# Methods -------------------------------------------------------------------
batting <- tbl(dps, "Batting")
-dim(batting)
-colnames(batting)
-head(batting)
+
+length(dim(batting)) == 2
+
+length(colnames(batting)) > 1
+nrow(head(batting, n=10L))
# co* verbs
cc <- collapse(batting)
@@ -40,32 +51,28 @@ cc <- collect(batting)
# Data manipulation verbs ---------------------------------------------------
-filter(batting, yearID > 2005, G > 130)
-select(batting, playerID:lgID)
-arrange(batting, playerID, desc(yearID))
-summarise(batting, G = mean(G), n = n())
-mutate(batting, rbi2 = if(!is.null(AB) & AB > 0) 1.0 * R / AB else 0)
+nrow(head(filter(batting, yearID > 2005, G > 130), n=10L))
+nrow(head(select(batting, playerID:lgID), n=10L))
+nrow(head(arrange(batting, playerID, desc(yearID)), n=10L))
+length(summarise(batting, G = mean(G), n = n())) > 1
+nrow(head(mutate(batting, rbi2 = if(!is.null(AB) & AB > 0) 1.0 * R / AB else
0), n=10L))
# note that all operations are lazy: they don't do anything until you
# request the data, either by `print()`ing it (which shows the first ten
# rows), by looking at the `head()`, or `collect()` the results locally.
-
-cat("#~BeginVariableOutput~#\n")
-system.time(recent <- filter(batting, yearID > 2010))
-system.time(collect(recent))
-cat("#~EndVariableOutput~#\n")
+nrow(head(collect(filter(batting, yearID > 2010)), n=10L))
# Group by operations -------------------------------------------------------
# To perform operations by group, create a grouped object with group_by
players <- group_by(batting, playerID)
-group_size(players)
-summarise(players, mean_g = mean(G), best_ab = max(AB))
+length(group_size(players)) > 1
+nrow(head(summarise(players, mean_g = mean(G), best_ab = max(AB)), n=10L))
# When you group by multiple level, each summarise peels off one level
per_year <- group_by(batting, playerID, yearID)
stints <- summarise(per_year, stints = max(stint))
-filter(stints, stints > 3)
-summarise(stints, max(stints))
+nrow(head(filter(stints, stints > 3), n=10L))
+nrow(head(summarise(stints, max(stints)), n=10L))
# Joins ---------------------------------------------------------------------
player_info <- select(tbl(dps, "Master"), playerID,
@@ -73,21 +80,24 @@ player_info <- select(tbl(dps, "Master")
hof <- select(filter(tbl(dps, "HallOfFame"), inducted == "Y"),
playerID, votedBy, category)
+invisible(suppressMessages( {
+
# Match players and their hall of fame data
-inner_join(player_info, hof)
+print(nrow(head(inner_join(player_info, hof), n=10L)))
# Keep all players, match hof data where available
-left_join(player_info, hof)
+print(nrow(head(left_join(player_info, hof), n=10L)))
# Find only players in hof
-semi_join(player_info, hof)
+print(nrow(head(semi_join(player_info, hof), n=10L)))
# Find players not in hof
-anti_join(player_info, hof)
+print(nrow(head(anti_join(player_info, hof), n=10L)))
+}))
# TODO: set ops
# Arbitrary SQL -------------------------------------------------------------
# You can also provide sql as is, using the sql function:
batting2008 <- tbl(dps,
sql('SELECT * FROM "Batting" WHERE "yearID" = 2008'))
-batting2008
+nrow(head(batting2008, n=10L))
print("SUCCESS")
diff --git a/clients/R/Tests/dplyr.stable.err b/clients/R/Tests/dplyr.stable.err
--- a/clients/R/Tests/dplyr.stable.err
+++ b/clients/R/Tests/dplyr.stable.err
@@ -31,51 +31,7 @@ stderr of test 'dplyr` in directory 'cli
# 14:31:12 >
-Attaching package: ‘dplyr’
+# 17:39:45 >
+# 17:39:45 > "Done."
+# 17:39:45 >
-The following object is masked from ‘package:MonetDB.R’:
-
- src_monetdb
-
-The following objects are masked from ‘package:stats’:
-
- filter, lag
-
-The following objects are masked from ‘package:base’:
-
- intersect, setdiff, setequal, union
-
-Creating table: AllstarFull
-Creating table: Appearances
-Creating table: AwardsManagers
-Creating table: AwardsPlayers
-Creating table: AwardsShareManagers
-Creating table: AwardsSharePlayers
-Creating table: Batting
-Creating table: BattingPost
-Creating table: Fielding
-Creating table: FieldingOF
-Creating table: FieldingPost
-Creating table: HallOfFame
-Creating table: LahmanData
-Creating table: Managers
-Creating table: ManagersHalf
-Creating table: Master
-Creating table: Pitching
-Creating table: PitchingPost
-Creating table: Salaries
-Creating table: Schools
-Creating table: SchoolsPlayers
-Creating table: SeriesPost
-Creating table: Teams
-Creating table: TeamsFranchises
-Creating table: TeamsHalf
-Joining by: "playerID"
-Joining by: "playerID"
-Joining by: "playerID"
-Joining by: "playerID"
-
-# 15:33:59 >
-# 15:33:59 > "Done."
-# 15:33:59 >
-
diff --git a/clients/R/Tests/dplyr.stable.out b/clients/R/Tests/dplyr.stable.out
--- a/clients/R/Tests/dplyr.stable.out
+++ b/clients/R/Tests/dplyr.stable.out
@@ -20,988 +20,28 @@ stdout of test 'dplyr` in directory 'cli
Ready.
-# 16:01:03 >
-# 16:01:03 > "R" "--vanilla" "--slave" "--args" "36798"
-# 16:01:03 >
+# 17:39:27 >
+# 17:39:27 > "R" "--vanilla" "--slave" "--args" "34068"
+# 17:39:27 >
-[1] 97889 24
- [1] "playerID" "yearID" "stint" "teamID" "lgID" "G"
- [7] "G_batting" "AB" "R" "H" "X2B" "X3B"
-[13] "HR" "RBI" "SB" "CS" "BB" "SO"
-[19] "IBB" "HBP" "SH" "SF" "GIDP" "G_old"
- playerID yearID stint teamID lgID G G_batting AB R H X2B X3B HR RBI SB CS
-1 aardsda01 2004 1 SFN NL 11 11 0 0 0 0 0 0 0 0 0
-2 aardsda01 2006 1 CHN NL 45 43 2 0 0 0 0 0 0 0 0
-3 aardsda01 2007 1 CHA AL 25 2 0 0 0 0 0 0 0 0 0
-4 aardsda01 2008 1 BOS AL 47 5 1 0 0 0 0 0 0 0 0
-5 aardsda01 2009 1 SEA AL 73 3 0 0 0 0 0 0 0 0 0
-6 aardsda01 2010 1 SEA AL 53 4 0 0 0 0 0 0 0 0 0
- BB SO IBB HBP SH SF GIDP G_old
-1 0 0 0 0 0 0 0 11
-2 0 0 0 0 1 0 0 45
-3 0 0 0 0 0 0 0 2
-4 0 1 0 0 0 0 0 5
-5 0 0 0 0 0 0 0 NA
-6 0 0 0 0 0 0 0 NA
-Source: MonetDB 11.19.0 (unreleased) []
-From: Batting [1,126 x 24]
-Filter: yearID > 2005, G > 130
-
- playerID yearID stint teamID lgID G G_batting AB R H X2B X3B HR RBI
-1 abreubo01 2007 1 NYA AL 158 158 605 123 171 40 5 16 101
-2 abreubo01 2008 1 NYA AL 156 156 609 100 180 39 4 20 100
-3 abreubo01 2009 1 LAA AL 152 152 563 96 165 29 3 15 103
-4 abreubo01 2010 1 LAA AL 154 154 573 88 146 41 1 20 78
-5 abreubo01 2011 1 LAA AL 142 142 502 54 127 30 1 8 60
-6 ackledu01 2012 1 SEA AL 153 NA 607 84 137 22 2 12 50
-7 alonsyo01 2012 1 SDN NL 155 NA 549 47 150 39 0 9 62
-8 altuvjo01 2012 1 HOU NL 147 NA 576 80 167 34 4 7 37
-9 alvarpe01 2012 1 PIT NL 149 NA 525 64 128 25 1 30 85
-10 amezaal01 2006 1 FLO NL 132 132 334 42 87 9 3 3 19
-.. ... ... ... ... ... ... ... ... ... ... ... ... .. ...
-Variables not shown: SB (dbl), CS (dbl), BB (dbl), SO (dbl), IBB (dbl), HBP
- (dbl), SH (dbl), SF (dbl), GIDP (dbl), G_old (dbl)
-Source: MonetDB 11.19.0 (unreleased) []
-From: Batting [97,889 x 5]
-
- playerID yearID stint teamID lgID
-1 aardsda01 2004 1 SFN NL
-2 aardsda01 2006 1 CHN NL
-3 aardsda01 2007 1 CHA AL
-4 aardsda01 2008 1 BOS AL
-5 aardsda01 2009 1 SEA AL
-6 aardsda01 2010 1 SEA AL
-7 aardsda01 2012 1 NYA AL
-8 aaronha01 1954 1 ML1 NL
-9 aaronha01 1955 1 ML1 NL
-10 aaronha01 1956 1 ML1 NL
-.. ... ... ... ... ...
-Source: MonetDB 11.19.0 (unreleased) []
-From: Batting [97,889 x 24]
-Arrange: playerID, desc(yearID)
-
- playerID yearID stint teamID lgID G G_batting AB R H X2B X3B HR RBI
-1 aardsda01 2013 1 NYN NL 43 43 0 0 0 0 0 0 0
-2 aardsda01 2012 1 NYA AL 1 NA NA NA NA NA NA NA NA
-3 aardsda01 2010 1 SEA AL 53 4 0 0 0 0 0 0 0
-4 aardsda01 2009 1 SEA AL 73 3 0 0 0 0 0 0 0
-5 aardsda01 2008 1 BOS AL 47 5 1 0 0 0 0 0 0
-6 aardsda01 2007 1 CHA AL 25 2 0 0 0 0 0 0 0
-7 aardsda01 2006 1 CHN NL 45 43 2 0 0 0 0 0 0
-8 aardsda01 2004 1 SFN NL 11 11 0 0 0 0 0 0 0
-9 aaronha01 1976 1 ML4 AL 85 85 271 22 62 8 0 10 35
-10 aaronha01 1975 1 ML4 AL 137 137 465 45 109 16 2 12 60
-.. ... ... ... ... ... ... ... ... .. ... ... ... .. ...
-Variables not shown: SB (dbl), CS (dbl), BB (dbl), SO (dbl), IBB (dbl), HBP
- (dbl), SH (dbl), SF (dbl), GIDP (dbl), G_old (dbl)
-Source: MonetDB 11.19.0 (unreleased) []
-From: <derived table> [?? x 2]
-
- G n
-1 51.65408 97889
-.. ... ...
-Source: MonetDB 11.19.0 (unreleased) []
-From: Batting [97,889 x 25]
-
- playerID yearID stint teamID lgID G G_batting AB R H X2B X3B HR RBI
-1 aardsda01 2004 1 SFN NL 11 11 0 0 0 0 0 0 0
-2 aardsda01 2006 1 CHN NL 45 43 2 0 0 0 0 0 0
-3 aardsda01 2007 1 CHA AL 25 2 0 0 0 0 0 0 0
-4 aardsda01 2008 1 BOS AL 47 5 1 0 0 0 0 0 0
-5 aardsda01 2009 1 SEA AL 73 3 0 0 0 0 0 0 0
-6 aardsda01 2010 1 SEA AL 53 4 0 0 0 0 0 0 0
-7 aardsda01 2012 1 NYA AL 1 NA NA NA NA NA NA NA NA
-8 aaronha01 1954 1 ML1 NL 122 122 468 58 131 27 6 13 69
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list