Changeset: b01c80c4e44f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b01c80c4e44f
Modified Files:
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/bat5.h
monetdb5/modules/kernel/bat5.mal
monetdb5/modules/mal/Tests/inspect05.stable.out
monetdb5/tests/gdkTests/Tests/subgroup.mal
Branch: Oct2014
Log Message:
As discussed closing down the MAL interface that wouldn't
be needed once we reach the full void-headed column.
1) bat.deleteHead
Dropped signature and body, but it should also be followed up by
deleting the BATdelHead and friends in GDK.
2) bat.setHash
Dropped the property argument (not used) and return a boolean.
3) bat.setImprints
Added to allow for explicit creation and return a boolean.
diffs (119 lines):
diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c
--- a/monetdb5/modules/kernel/bat5.c
+++ b/monetdb5/modules/kernel/bat5.c
@@ -1961,18 +1961,32 @@ BKCaccbuild_std(bat *ret, const bat *bid
throw(MAL, "Accelerator", PROGRAM_NYI);
}
-
str
-BKCsetHash(bit *ret, const bat *bid, const bit *prop)
+BKCsetHash(bit *ret, const bat *bid)
{
- BAT *b;
+ BAT *b, *bn;
(void) ret;
- (void) prop; /* fool compiler */
if ((b = BATdescriptor(*bid)) == NULL) {
throw(MAL, "bat.setHash", RUNTIME_OBJECT_MISSING);
}
- BAThash(BATmirror(b), 0);
+ bn = BAThash(BATmirror(b), 0);
+ *ret = b == bn;
+ BBPreleaseref(b->batCacheid);
+ return MAL_SUCCEED;
+}
+
+str
+BKCsetImprints(bit *ret, const bat *bid)
+{
+ BAT *b, *bn;
+
+ (void) ret;
+ if ((b = BATdescriptor(*bid)) == NULL) {
+ throw(MAL, "bat.setHash", RUNTIME_OBJECT_MISSING);
+ }
+ bn = BATimprints(b);
+ *ret = b == bn;
BBPreleaseref(b->batCacheid);
return MAL_SUCCEED;
}
diff --git a/monetdb5/modules/kernel/bat5.h b/monetdb5/modules/kernel/bat5.h
--- a/monetdb5/modules/kernel/bat5.h
+++ b/monetdb5/modules/kernel/bat5.h
@@ -115,7 +115,8 @@ bat5_export str BKCmadvise(bit *res, con
bat5_export str BKCmadvise2(bit *res, const bat *bid, const int *mode);
bat5_export str BKCaccbuild(bat *ret, const bat *bid, const char * const *acc,
const ptr *param);
bat5_export str BKCaccbuild_std(bat *ret, const bat *bid, const int *acc);
-bat5_export str BKCsetHash(bit *ret, const bat *bid, const bit *prop);
+bat5_export str BKCsetHash(bit *ret, const bat *bid);
+bat5_export str BKCsetImprints(bit *ret, const bat *bid);
bat5_export str BKCsetSequenceBase(bat *r, const bat *bid, const oid *o);
bat5_export str BKCsetSequenceBaseNil(bat *r, const bat *bid, const oid *o);
bat5_export str BKCgetSequenceBase(oid *r, const bat *bid);
diff --git a/monetdb5/modules/kernel/bat5.mal b/monetdb5/modules/kernel/bat5.mal
--- a/monetdb5/modules/kernel/bat5.mal
+++ b/monetdb5/modules/kernel/bat5.mal
@@ -239,11 +239,6 @@ command delete(b:bat[:any_1, :any_2]) :b
address BKCdelete_all
comment "Delete all BUNs in a BAT.";
-command deleteHead(b:bat[:any_1, :any_2], src:bat[:any_1,:any]) :bat[:any_1,
:any_2]
-address BKCdelete_bat
-comment "Delete from the first BAT all BUNs with a corresponding head
- in the second.";
-
command delete(b:bat[:any_1, :any_2], src:bat[:any_1,:any_2])
:bat[:any_1,:any_2]
address BKCdelete_bat_bun
comment "Delete from the first BAT all BUNs with a corresponding BUN
@@ -340,10 +335,14 @@ command setMemoryMap(b:bat[:oid,:any_2],
address BKCmmap2
comment "Alias for mmap(b, mode, mode, mode, mode)";
-command setHash(b:bat[:oid,:any_2],prop:bit):bit
+command setHash(b:bat[:oid,:any_2]):bit
address BKCsetHash
comment "Create a hash structure on the column";
+command setImpints(b:bat[:oid,:any_2]):bit
+address BKCsetImpints
+comment "Create n imprints structure on the column";
+
command isSynced (b1:bat[:oid,:any_2], b2:bat[:oid,:any_4]) :bit
address BKCisSynced
comment "Tests whether two BATs are synced or not. ";
diff --git a/monetdb5/modules/mal/Tests/inspect05.stable.out
b/monetdb5/modules/mal/Tests/inspect05.stable.out
--- a/monetdb5/modules/mal/Tests/inspect05.stable.out
+++ b/monetdb5/modules/mal/Tests/inspect05.stable.out
@@ -45,7 +45,6 @@ end main;
[ "delete", "command", "bat",
"(b:bat[:any_1,:any_2]):bat[:any_1,:any_2] ",
"BKCdelete_all;"
]
[ "delete", "command", "bat",
"(b:bat[:any_1,:any_2],h:any_1):bat[:any_1,:any_2] ",
"BKCdelete;"
]
[ "delete", "command", "bat",
"(b:bat[:any_1,:any_2],h:any_1,t:any_2):bat[:any_1,:any_2] ",
"BKCdelete_bun;"
]
-[ "deleteHead", "command", "bat",
"(b:bat[:any_1,:any_2],src:bat[:any_1,:any]):bat[:any_1,:any_2] ",
"BKCdelete_bat;" ]
[ "densebat", "command", "bat",
"(size:wrd):bat[:void,:void] ",
"BKCdensebat;"
]
[ "getAccess", "command", "bat",
"(b:bat[:any_1,:any_2]):str ",
"BKCgetAccess;" ]
[ "getAlpha", "command", "bat",
"(b:bat[:any_1,:any_2]):bat[:any_1,:any_2] ",
"BKCgetAlpha;" ]
@@ -125,8 +124,9 @@ end main;
[ "setCold", "command", "bat", "(b:bat[:oid,:any_1]):void ",
"BKCcoldBAT;" ]
[ "setColumn", "command", "bat", "(b:bat[:oid,:any_2],h:str,t:str):void
", "BKCsetColumns;" ]
[ "setColumn", "command", "bat", "(b:bat[:oid,:any_2],t:str):void ",
"BKCsetColumn;" ]
-[ "setHash", "command", "bat", "(b:bat[:oid,:any_2],prop:bit):bit ",
"BKCsetHash;" ]
+[ "setHash", "command", "bat", "(b:bat[:oid,:any_2]):bit ",
"BKCsetHash;" ]
[ "setHot", "command", "bat", "(b:bat[:oid,:any_2]):void ",
"BKChotBAT;" ]
+[ "setImprints", "command", "bat", "(b:bat[:oid,:any_2]):bit ",
"BKCsetImprints;" ]
[ "setKey", "command", "bat",
"(b:bat[:any_1,:any_2],mode:bit):bat[:any_1,:any_2] ",
"BKCsetkey;" ]
[ "setMemoryMap", "command", "bat",
"(b:bat[:oid,:any_2],mode:int):bit ", "BKCmmap2;" ]
[ "setMemoryMap", "command", "bat",
"(b:bat[:oid,:any_2],head_mode:int,tail_mode:int,hheap_mode:int,theap_mode:int):bit
", "BKCmmap;" ]
diff --git a/monetdb5/tests/gdkTests/Tests/subgroup.mal
b/monetdb5/tests/gdkTests/Tests/subgroup.mal
--- a/monetdb5/tests/gdkTests/Tests/subgroup.mal
+++ b/monetdb5/tests/gdkTests/Tests/subgroup.mal
@@ -170,7 +170,7 @@ io.print(a4,g,g4);
io.print(e4,h4);
# group random values with preexisting hash
-bat.setHash(a4,true);
+bat.setHash(a4);
(g4,e4,h4) := group.subgroup(a4);
io.print(a4,g4);
io.print(e4,h4);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list