Changeset: 939c5134e01c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=939c5134e01c
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        monetdb5/modules/kernel/algebra.c
        sql/backends/monet5/sql_statement.c
        testing/Mtest.py.in
Branch: default
Log Message:

Remove single argument algebra.unique: always specify candidate list.


diffs (84 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -676,8 +676,7 @@ stdout of test 'MAL-signatures` in direc
 [ "algebra",   "thetajoin",    "command algebra.thetajoin(X_1:bat[:any_1], 
X_2:bat[:any_1], X_3:bat[:oid], X_4:bat[:oid], X_5:int, X_6:bit, 
X_7:lng):bat[:oid] ",      "ALGthetajoin1;",       ""      ]
 [ "algebra",   "thetajoin",    "command algebra.thetajoin(X_2:bat[:any_1], 
X_3:bat[:any_1], X_4:bat[:oid], X_5:bat[:oid], X_6:int, X_7:bit, X_8:lng) 
(X_0:bat[:oid], X_1:bat[:oid]) ", "ALGthetajoin;",        ""      ]
 [ "algebra",   "thetaselect",  "command algebra.thetaselect(X_1:bat[:any_1], 
X_2:bat[:oid], X_3:any_1, X_4:str):bat[:oid] ",   "ALGthetaselect2;",     ""    
  ]
-[ "algebra",   "unique",       "command 
algebra.unique(X_1:bat[:any_1]):bat[:oid] ",   "ALGunique1;",  ""      ]
-[ "algebra",   "unique",       "command algebra.unique(X_1:bat[:any_1], 
X_2:bat[:oid]):bat[:oid] ",    "ALGunique2;",  ""      ]
+[ "algebra",   "unique",       "command algebra.unique(X_1:bat[:any_1], 
X_2:bat[:oid]):bat[:oid] ",    "ALGunique;",   ""      ]
 [ "bat",       "append",       "command bat.append(X_1:bat[:any_1], 
X_2:bat[:any_1], X_3:bat[:oid], X_4:bit):bat[:any_1] ",    
"BKCappend_cand_force_wrap;",   ""      ]
 [ "bat",       "append",       "command bat.append(X_1:bat[:any_1], 
X_2:bat[:any_1], X_3:bat[:oid]):bat[:any_1] ",     "BKCappend_cand_wrap;", ""   
   ]
 [ "bat",       "append",       "command bat.append(X_1:bat[:any_1], 
X_2:bat[:any_1], X_3:bit):bat[:any_1] ",   "BKCappend_force_wrap;",        ""   
   ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -789,8 +789,7 @@ stdout of test 'MAL-signatures` in direc
 [ "algebra",   "thetajoin",    "command algebra.thetajoin(X_1:bat[:any_1], 
X_2:bat[:any_1], X_3:bat[:oid], X_4:bat[:oid], X_5:int, X_6:bit, 
X_7:lng):bat[:oid] ",      "ALGthetajoin1;",       ""      ]
 [ "algebra",   "thetajoin",    "command algebra.thetajoin(X_2:bat[:any_1], 
X_3:bat[:any_1], X_4:bat[:oid], X_5:bat[:oid], X_6:int, X_7:bit, X_8:lng) 
(X_0:bat[:oid], X_1:bat[:oid]) ", "ALGthetajoin;",        ""      ]
 [ "algebra",   "thetaselect",  "command algebra.thetaselect(X_1:bat[:any_1], 
X_2:bat[:oid], X_3:any_1, X_4:str):bat[:oid] ",   "ALGthetaselect2;",     ""    
  ]
-[ "algebra",   "unique",       "command 
algebra.unique(X_1:bat[:any_1]):bat[:oid] ",   "ALGunique1;",  ""      ]
-[ "algebra",   "unique",       "command algebra.unique(X_1:bat[:any_1], 
X_2:bat[:oid]):bat[:oid] ",    "ALGunique2;",  ""      ]
+[ "algebra",   "unique",       "command algebra.unique(X_1:bat[:any_1], 
X_2:bat[:oid]):bat[:oid] ",    "ALGunique;",   ""      ]
 [ "bat",       "append",       "command bat.append(X_1:bat[:any_1], 
X_2:bat[:any_1], X_3:bat[:oid], X_4:bit):bat[:any_1] ",    
"BKCappend_cand_force_wrap;",   ""      ]
 [ "bat",       "append",       "command bat.append(X_1:bat[:any_1], 
X_2:bat[:any_1], X_3:bat[:oid]):bat[:any_1] ",     "BKCappend_cand_wrap;", ""   
   ]
 [ "bat",       "append",       "command bat.append(X_1:bat[:any_1], 
X_2:bat[:any_1], X_3:bit):bat[:any_1] ",   "BKCappend_force_wrap;",        ""   
   ]
diff --git a/monetdb5/modules/kernel/algebra.c 
b/monetdb5/modules/kernel/algebra.c
--- a/monetdb5/modules/kernel/algebra.c
+++ b/monetdb5/modules/kernel/algebra.c
@@ -750,7 +750,7 @@ ALGcopy(bat *result, const bat *bid)
 }
 
 static str
-ALGunique2(bat *result, const bat *bid, const bat *sid)
+ALGunique(bat *result, const bat *bid, const bat *sid)
 {
        BAT *b, *s = NULL, *bn = NULL;
 
@@ -773,12 +773,6 @@ ALGunique2(bat *result, const bat *bid, 
 }
 
 static str
-ALGunique1(bat *result, const bat *bid)
-{
-       return ALGunique2(result, bid, NULL);
-}
-
-static str
 ALGcrossproduct(bat *l, bat *r, const bat *left, const bat *right, const bit 
*max_one)
 {
        BAT *L, *R, *bn1, *bn2 = NULL;
@@ -1410,8 +1404,7 @@ mel_func algebra_init_funcs[] = {
  command("algebra", "sort", ALGsort31, false, "Returns a copy of the BAT 
sorted on tail values.\nThe order is descending if the reverse bit is 
set.\nThis is a stable sort if the stable bit is set.", args(1,7, 
batargany("",1),batargany("b",1),batarg("o",oid),batarg("g",oid),arg("reverse",bit),arg("nilslast",bit),arg("stable",bit))),
  command("algebra", "sort", ALGsort32, false, "Returns a copy of the BAT 
sorted on tail values and a BAT that\nspecifies how the input was 
reordered.\nThe order is descending if the reverse bit is set.\nThis is a 
stable sort if the stable bit is set.", args(2,8, 
batargany("",1),batarg("",oid),batargany("b",1),batarg("o",oid),batarg("g",oid),arg("reverse",bit),arg("nilslast",bit),arg("stable",bit))),
  command("algebra", "sort", ALGsort33, false, "Returns a copy of the BAT 
sorted on tail values, a BAT that specifies\nhow the input was reordered, and a 
BAT with group information.\nThe order is descending if the reverse bit is 
set.\nThis is a stable sort if the stable bit is set.", args(3,9, 
batargany("",1),batarg("",oid),batarg("",oid),batargany("b",1),batarg("o",oid),batarg("g",oid),arg("reverse",bit),arg("nilslast",bit),arg("stable",bit))),
- command("algebra", "unique", ALGunique2, false, "Select all unique values 
from the tail of the first input.\nInput is a dense-headed BAT, the second 
input is a\ndense-headed BAT with sorted tail, output is a dense-headed\nBAT 
with in the tail the head value of the input BAT that was\nselected.  The 
output BAT is sorted on the tail value.  The\nsecond input BAT is a list of 
candidates.", args(1,3, batarg("",oid),batargany("b",1),batarg("s",oid))),
- command("algebra", "unique", ALGunique1, false, "Select all unique values 
from the tail of the input.\nInput is a dense-headed BAT, output is a 
dense-headed BAT with\nin the tail the head value of the input BAT that was 
selected.\nThe output BAT is sorted on the tail value.", args(1,2, 
batarg("",oid),batargany("b",1))),
+ command("algebra", "unique", ALGunique, false, "Select all unique values from 
the tail of the first input.\nInput is a dense-headed BAT, the second input is 
a\ndense-headed BAT with sorted tail, output is a dense-headed\nBAT with in the 
tail the head value of the input BAT that was\nselected.  The output BAT is 
sorted on the tail value.  The\nsecond input BAT is a list of candidates.", 
args(1,3, batarg("",oid),batargany("b",1),batarg("s",oid))),
  command("algebra", "crossproduct", ALGcrossproduct2, false, "Returns 2 
columns with all BUNs, consisting of the head-oids\nfrom 'left' and 'right' for 
which there are BUNs in 'left'\nand 'right' with equal tails", args(2,5, 
batarg("l",oid),batarg("r",oid),batargany("left",1),batargany("right",2),arg("max_one",bit))),
  command("algebra", "crossproduct", ALGcrossproduct1, false, "Compute the 
cross product of both input bats; but only produce left output", args(1,4, 
batarg("",oid),batargany("left",1),batargany("right",2),arg("max_one",bit))),
  command("algebra", "join", ALGjoin, false, "Join", args(2,8, 
batarg("",oid),batarg("",oid),batargany("l",1),batargany("r",1),batarg("sl",oid),batarg("sr",oid),arg("nil_matches",bit),arg("estimate",lng))),
diff --git a/sql/backends/monet5/sql_statement.c 
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -281,6 +281,7 @@ stmt_unique(backend *be, stmt *s)
                return NULL;
 
        q = pushArgument(mb, q, s->nr);
+       q = pushNil(mb, q, TYPE_bat); /* candidate list */
        if (q) {
                stmt *ns = stmt_create(be->mvc->sa, st_unique);
                if (ns == NULL) {
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1630,7 +1630,7 @@ def GetBitsAndModsAndThreads(env) :
                                  stderr=process.PIPE, text=True)
             input = '''\
                 c := mdb.modules();
-                modsid := algebra.unique(c);
+                modsid := algebra.unique(c,nil:bat);
                 mods := algebra.projection(modsid,c);
                 s := "\\nModules: ";
                 sep := "";
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to