Similarly,
if (dic.size() == 0)
return new std::vector<std::string>();
is wrong, since a column that contains only null would return an empty vector
instead of a list of empty strings.
Replacing the two lines above by
if (dic.size() == 0)
return new std::vector<std::string>(mask.cnt(), "");
fixes the issue.
Thanks,
From: [email protected]
[mailto:[email protected]] On Behalf Of Dominique Prunier
Sent: Tuesday, January 31, 2012 5:42 PM
To: FastBit Users
Subject: [FastBit-users] Bug in ibis::category::selectStrings
Hi,
I just discovered and fixed a strange bug ibis::category::selectStrings.
If you have a column with only one distinct value and some empty values, it
returns invalid results.
It seems that in this case, that the dictionary size is 1 (the implicit empty
string doesn’t count for 1), and then the following code is wrong:
if (dic.size() == 1) {
return new std::vector<std::string>(mask.cnt(), dic[1]);
}
Simply removing this block fixed the issue.
Before:
dom@vanilla 1 % tcapi . 1=1 p_name2 s
tcapi: applying "1=1" on data in . produced 4 hits
p_name2[4]="name2@43" "name2@43" "name2@43" "name2@43"
After:
dom@vanilla 1 % tcapi . 1=1 p_name2 s
tcapi: applying "1=1" on data in . produced 4 hits
p_name2[4]="" "name2@43" "" ""
The p_name2 column actually contains “”, “name2@43”, “”, “”, so the second test
is correct.
Thanks,
Dominique Prunier
APG Lead Developper
[cid:[email protected]]
4388, rue Saint-Denis
Bureau 309
Montreal (Quebec) H2J 2L1
Tel. +1 514-842-6767 x310
Fax +1 514-842-3989
[email protected]<mailto:[email protected]>
www.watch4net.com<http://www.watch4net.com/>
This message is for the designated recipient only and may contain privileged,
proprietary, or otherwise private information. If you have received it in
error, please notify the sender immediately and delete the original. Any other
use of this electronic mail by you is prohibited.
Ce message est pour le récipiendaire désigné seulement et peut contenir des
informations privilégiées, propriétaires ou autrement privées. Si vous l'avez
reçu par erreur, S.V.P. avisez l'expéditeur immédiatement et effacez
l'original. Toute autre utilisation de ce courrier électronique par vous est
prohibée.
<<inline: image001.gif>>
_______________________________________________ FastBit-users mailing list [email protected] https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
