[Monetdb-developers] multiplex string-add returns empty BAT

Peter Roozemaal mathfox at xs4all.nl
Thu May 18 20:25:03 CEST 2006


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 at 0);
> MonetDB>yyy.print();
> #-----------------#
> # t     h         # name
> # void  str       # type
> #-----------------#
> [ 0 at 0,    "aap"   ]
> [ 1 at 0,    "noot"  ]
> [ 2 at 0,    "mies"  ]
> MonetDB>(yyy [+] yyy).print();
> #-------------------------#
> # h     t                 # name
> # void  str               # type
> #-------------------------#
> [ 0 at 0,    "aapaap"        ]
> [ 1 at 0,    "nootnoot"      ]
> [ 2 at 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 at lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/monetdb-developers
>>
> 





More information about the developers-list mailing list