On Tue, Jul 01, 2008 at 05:44:56PM +0200, Simon Berther wrote:
> Hello,
> I'm developing in MAL accessing commands and functions from C++
> over the MAPI-library.
> My task is to delete some BUNs from a BAT.
> The problem: The BAT with some deleted BUNs has a different
> order than before.
> I do it the following way:
> c:bat[:oid,:int] := bbp.bind("joe");
> slice:bat[:oid,:int] := algebra.slice(c,4,6);
> bat.delete(c,slice);
> The original BAT "joe":
> #-----------------#
> # h t # name
> # oid int # type
> #-----------------#
> [ [EMAIL PROTECTED], -1 ]
> [ [EMAIL PROTECTED], 2 ]
> [ [EMAIL PROTECTED], 3 ]
> [ [EMAIL PROTECTED], -1 ]
> [ [EMAIL PROTECTED], -2 ] <- to be deleted
> [ [EMAIL PROTECTED], 5 ] <- to be deleted
> [ [EMAIL PROTECTED], -2 ] <- to be deleted
> After delete:
> The original BAT "joe":
> #-----------------#
> # h t # name
> # oid int # type
> #-----------------#
> [ [EMAIL PROTECTED], -1 ] <- not in right order, why?
> [ [EMAIL PROTECTED], -1 ]
> [ [EMAIL PROTECTED], 2 ]
> [ [EMAIL PROTECTED], 3 ]
> Why is this so and how can I prevent MonetDB to change the
> order, while deleting BUNs.
Thats is indeed and correct. We simply move the deleted values into the
delta part (ie the area before the first valid value), this is needed
for transactions.
> The order is important, because I'd like to work with position
> and slices to read my BUNs.
Ie you want 'void' head bats. Then you can never 'really' delete
a value. But instead write a nil value into it (using bat.replace(b, h, t,
true). Or keep an extra bat with the deleted oids.
Niels
> Thanks for helping!
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Monetdb-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/monetdb-developers
--
Niels Nes, Centre for Mathematics and Computer Science (CWI)
Kruislaan 413, 1098 SJ Amsterdam, The Netherlands
room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312
url: http://www.cwi.nl/~niels e-mail: [EMAIL PROTECTED]
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Monetdb-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-developers