[Monetdb-developers] multiplex string-add returns empty BAT
I am using monetdb 4.10.2 on an AMD64 Gentoo Linux system (the Gentoo ebuild). I suspect there's a bug in the handling of the multiplex string-add: The following mil code: var xxx := "aap noot mies".split(" "); (xxx [+] xxx).print(); prints an empty BAT: #-----------------# # h t # name # void str # type #-----------------# where I expected: [ nil, "aapaap" ] [ nil, "nootnoot" ] [ nil, "miesmies" ] It looks like every invocation of the string [+] gives an empty result. Greetings, Peter Roozemaal.
Hi Peter, Thanks for your interest in MonetDB. On 18-05-2006 19:54:19 +0200, Peter Roozemaal wrote:
I am using monetdb 4.10.2 on an AMD64 Gentoo Linux system (the Gentoo ebuild). I suspect there's a bug in the handling of the multiplex string-add:
Just for the record, this probably means you're running an x86 profile, right? The ebuild is not keyworded amd64 and is said to have issues with compilation on amd64.
The following mil code:
var xxx := "aap noot mies".split(" "); (xxx [+] xxx).print();
prints an empty BAT:
#-----------------# # h t # name # void str # type #-----------------#
where I expected: [ nil, "aapaap" ] [ nil, "nootnoot" ] [ nil, "miesmies" ]
It looks like every invocation of the string [+] gives an empty result.
I tried this on my Mserver and got indeed the same results, after trying some alternative things as well. So it looks like a bug to me.
Peter, the empty result is correct in this case: a multiplex does not match BUNs by position, but by an equi-join of the head columns. In your case the head column of the split-result is nil, and since nil never match with each other, the implicite equi-join result is empty, so is consequently the multiplex result. To get your desired result, you need to create a non-nil unique head column, e.g., via tmark() as shown below. Stefan ======== $ Mserver --trace < /tmp/xxx.mil # Monet Database Server V4.11.3 # Copyright (c) 1993-2006, CWI. All rights reserved. # Compiled for x86_64-redhat-linux-gnu/64bit with 64bit OIDs; dynamically linked. # Visit http://monetdb.cwi.nl/ for further information. MonetDB>var xxx := "aap noot mies".split(" "); MonetDB>xxx.print(); #-----------------# # h t # name # void str # type #-----------------# [ nil, "aap" ] [ nil, "noot" ] [ nil, "mies" ] MonetDB>(xxx [+] xxx).print(); #-----------------# # h t # name # void str # type #-----------------# MonetDB> MonetDB>var yyy := "aap noot mies".split(" ").tmark(0@0); MonetDB>yyy.print(); #-----------------# # t h # name # void str # type #-----------------# [ 0@0, "aap" ] [ 1@0, "noot" ] [ 2@0, "mies" ] MonetDB>(yyy [+] yyy).print(); #-------------------------# # h t # name # void str # type #-------------------------# [ 0@0, "aapaap" ] [ 1@0, "nootnoot" ] [ 2@0, "miesmies" ] MonetDB>quit(); ======== On Thu, May 18, 2006 at 07:54:19PM +0200, Peter Roozemaal wrote:
I am using monetdb 4.10.2 on an AMD64 Gentoo Linux system (the Gentoo ebuild). I suspect there's a bug in the handling of the multiplex string-add:
The following mil code:
var xxx := "aap noot mies".split(" "); (xxx [+] xxx).print();
prints an empty BAT:
#-----------------# # h t # name # void str # type #-----------------#
where I expected: [ nil, "aapaap" ] [ nil, "nootnoot" ] [ nil, "miesmies" ]
It looks like every invocation of the string [+] gives an empty result.
Greetings, Peter Roozemaal.
------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |
Hello Stefan, Now I try: mil>var yyy := [int]("1 2 3 4".split(" ")); mil>yyy.print(); #-----------------# # h t # name # void int # type #-----------------# [ nil, 1 ] [ nil, 2 ] [ nil, 3 ] [ nil, 4 ] mil>(yyy [+] yyy).print(); #-----------------# # h t # name # void int # type #-----------------# [ nil, 2 ] [ nil, 4 ] [ nil, 6 ] [ nil, 8 ] Would this be a bug then? I see an inconsistency with the [+] behaviour for strings. Greetings, Peter. Stefan Manegold wrote:
Peter,
the empty result is correct in this case: a multiplex does not match BUNs by position, but by an equi-join of the head columns. In your case the head column of the split-result is nil, and since nil never match with each other, the implicite equi-join result is empty, so is consequently the multiplex result. To get your desired result, you need to create a non-nil unique head column, e.g., via tmark() as shown below.
Stefan
======== $ Mserver --trace < /tmp/xxx.mil # Monet Database Server V4.11.3 # Copyright (c) 1993-2006, CWI. All rights reserved. # Compiled for x86_64-redhat-linux-gnu/64bit with 64bit OIDs; dynamically linked. # Visit http://monetdb.cwi.nl/ for further information. MonetDB>var xxx := "aap noot mies".split(" "); MonetDB>xxx.print(); #-----------------# # h t # name # void str # type #-----------------# [ nil, "aap" ] [ nil, "noot" ] [ nil, "mies" ] MonetDB>(xxx [+] xxx).print(); #-----------------# # h t # name # void str # type #-----------------# MonetDB> MonetDB>var yyy := "aap noot mies".split(" ").tmark(0@0); MonetDB>yyy.print(); #-----------------# # t h # name # void str # type #-----------------# [ 0@0, "aap" ] [ 1@0, "noot" ] [ 2@0, "mies" ] MonetDB>(yyy [+] yyy).print(); #-------------------------# # h t # name # void str # type #-------------------------# [ 0@0, "aapaap" ] [ 1@0, "nootnoot" ] [ 2@0, "miesmies" ] MonetDB>quit(); ========
On Thu, May 18, 2006 at 07:54:19PM +0200, Peter Roozemaal wrote:
I am using monetdb 4.10.2 on an AMD64 Gentoo Linux system (the Gentoo ebuild). I suspect there's a bug in the handling of the multiplex string-add:
The following mil code:
var xxx := "aap noot mies".split(" "); (xxx [+] xxx).print();
prints an empty BAT:
#-----------------# # h t # name # void str # type #-----------------#
where I expected: [ nil, "aapaap" ] [ nil, "nootnoot" ] [ nil, "miesmies" ]
It looks like every invocation of the string [+] gives an empty result.
Greetings, Peter Roozemaal.
------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
participants (3)
-
Fabian Groffen
-
Peter Roozemaal
-
Stefan Manegold