Hi John,
I just found out a curious thing. I'm using table::cursor to iterate
over result set and retrieving values using getColumnAs___ functions.
I'm actually checking for return value of the function to see, whether
there was anything wrong. The assumption is that any non-zero value
means an error. Right now, I have one query that is valid, but the
function returns 1, which seems to be quite impossible from the look
of the actual library code.
Should I only assume that negative value are errors?
Here is the code that gives the described result:
------------------------------------------------------------------------------------------------------------------------------
#include <fastbit/ibis.h>
#include <iostream>
int main(int argc, char *argv[]) {
if (argc <=1) return 1;
ibis::table *table = ibis::table::create(argv[1]);
ibis::table *result = table->select("count(*)", "1==1");
delete table;
ibis::table::cursor *cursor = result->createCursor();
cursor->fetch();
uint64_t count, ret;
ret = cursor->getColumnAsULong((uint32_t) 0,count);
std::cout << "Count is: " << count << ", return value is: " << ret <<
std::endl;
return 0;
}
------------------------------------------------------------------------------------------------------------------------------
When anything else is added to the "count(*)" in select clause, the
return value is 0, as expected.
Regards,
Petr
_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users