Changeset: 157748a2acc8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/157748a2acc8
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/MAL-signatures.test
monetdb5/modules/mal/pp_sort.c
sql/backends/monet5/rel_orderby.c
sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-0join-query.test
Branch: pp_hashjoin
Log Message:
removed 'pipeline ptr' from 'sop.fetch', now we have sop.fetch_global and
sop.fetch_local
diffs (147 lines):
diff --git a/clients/Tests/MAL-signatures-hge.test
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -50429,15 +50429,15 @@ pattern sop.add(X_0:bat[:oid], X_1:bat[:
SOPadd
add set of bats to the set of (ordered) parts
sop
-fetch
-pattern sop.fetch(X_0:bat[:oid]):bat[:any]...
-SOPfetch
-fetch a set of bats
+fetch_global
+pattern sop.fetch_global(X_0:bat[:oid]):bat[:any]...
+SOPfetch_global
+fetch a set of global bats
sop
-fetch
-pattern sop.fetch(X_0:bat[:oid], X_1:ptr):bat[:any]...
-SOPfetch
-fetch a set of bats
+fetch_local
+pattern sop.fetch_local(X_0:bat[:oid]):bat[:any]...
+SOPfetch_local
+fetch a set of thread's local bats
sop
new
pattern sop.new(X_0:int):bat[:oid]
diff --git a/clients/Tests/MAL-signatures.test
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -38799,15 +38799,15 @@ pattern sop.add(X_0:bat[:oid], X_1:bat[:
SOPadd
add set of bats to the set of (ordered) parts
sop
-fetch
-pattern sop.fetch(X_0:bat[:oid]):bat[:any]...
-SOPfetch
-fetch a set of bats
+fetch_global
+pattern sop.fetch_global(X_0:bat[:oid]):bat[:any]...
+SOPfetch_global
+fetch a set of global bats
sop
-fetch
-pattern sop.fetch(X_0:bat[:oid], X_1:ptr):bat[:any]...
-SOPfetch
-fetch a set of bats
+fetch_local
+pattern sop.fetch_local(X_0:bat[:oid]):bat[:any]...
+SOPfetch_local
+fetch a set of thread's local bats
sop
new
pattern sop.new(X_0:int):bat[:oid]
diff --git a/monetdb5/modules/mal/pp_sort.c b/monetdb5/modules/mal/pp_sort.c
--- a/monetdb5/modules/mal/pp_sort.c
+++ b/monetdb5/modules/mal/pp_sort.c
@@ -800,18 +800,12 @@ SOPadd(Client cntxt, MalBlkPtr mb, MalSt
}
static str
-SOPfetch(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
+SOPfetch_(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p, int wid)
{
(void)cntxt;
- (void)mb;
+
int nr = p->retc;
bat *qbat = getArgReference_bat(stk, p, p->retc);
- Pipeline *pp = NULL;
- int wid = 0;
- if (p->argc - p->retc == 2) {
- pp = (Pipeline *) *getArgReference_ptr(stk, p, p->retc + 1);
- wid = pp->wid;
- }
BAT *qb = BATdescriptor(*qbat);
if (!qb)
@@ -851,6 +845,20 @@ SOPfetch(Client cntxt, MalBlkPtr mb, Mal
return MAL_SUCCEED;
}
+static str
+SOPfetch_local(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
+{
+ Pipeline *pp = pipeline_get_thread_private_pipeline();
+
+ return SOPfetch_(cntxt, mb, stk, p, pp->wid);
+}
+
+static str
+SOPfetch_global(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
+{
+ return SOPfetch_(cntxt, mb, stk, p, 0);
+}
+
#include "mel.h"
static mel_func pp_sort_init_funcs[] = {
pattern("sort", "merge", PPmerge, false, "", args(3,7,
@@ -866,8 +874,8 @@ static mel_func pp_sort_init_funcs[] = {
batargany("r", 1), batarg("zzl", int), batargany("lc",
1), batargany("rc", 1))),
pattern("sop", "new", SOPnew, false, "Create set of (ordered) parts",
args(1,2, batarg("sop", oid), arg("nrworkers", int))),
pattern("sop", "add", SOPadd, false, "add set of bats to the set of (ordered)
parts", args(1,3, batarg("sop", oid), batarg("sop", oid), batvarargany("b",0))),
- pattern("sop", "fetch", SOPfetch, false, "fetch a set of bats", args(1,3,
batvarargany("res",0), batarg("tree", oid), arg("pipeline", ptr))),
- pattern("sop", "fetch", SOPfetch, false, "fetch a set of bats", args(1,2,
batvarargany("res",0), batarg("tree", oid))),
+ pattern("sop", "fetch_local", SOPfetch_local, false, "fetch a set of thread's
local bats", args(1,2, batvarargany("res",0), batarg("tree", oid))),
+ pattern("sop", "fetch_global", SOPfetch_global, false, "fetch a set of global
bats", args(1,2, batvarargany("res",0), batarg("tree", oid))),
{ .imp=NULL }
};
#include "mal_import.h"
diff --git a/sql/backends/monet5/rel_orderby.c
b/sql/backends/monet5/rel_orderby.c
--- a/sql/backends/monet5/rel_orderby.c
+++ b/sql/backends/monet5/rel_orderby.c
@@ -105,7 +105,7 @@ fetch(backend *be, InstrPtr sop, sql_rel
{
list *l = sa_list(be->mvc->sa);
int nr = list_length(rel->exps) + list_length(oexps), i = 0;
- InstrPtr q = newStmtArgs(be->mb, "sop", "fetch", nr + 2);
+ InstrPtr q = newStmtArgs(be->mb, "sop",
be->pipeline?"fetch_local":"fetch_global", nr + 1);
for(node *n = oexps->h; n; n = n->next, i++) {
sql_exp *e = n->data;
@@ -129,8 +129,6 @@ fetch(backend *be, InstrPtr sop, sql_rel
append(l, stmt_pp_alias(be, q, e, i));
}
pushArgument(be->mb, q, getArg(sop, 0));
- if (be->pipeline)
- pushArgument(be->mb, q, be->pipeline);
pushInstruction(be->mb, q);
return stmt_list(be, l);
}
diff --git
a/sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-0join-query.test
b/sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-0join-query.test
---
a/sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-0join-query.test
+++
b/sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-0join-query.test
@@ -44,8 +44,10 @@ querylog.define
1
sop.add
2
-sop.fetch
-3
+sop.fetch_global
+1
+sop.fetch_local
+2
sop.new
1
sort.merge
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]