Hi, Gaurav,

Would you mind try to give sum(req) a name through something like
"sum(req) as s"?

I suspect that the name for "sum(req)" should be _3 not _2.  The
expression _2 might have been translated to "site" which might be a
string valued column.  An attempt to perform sum over string values
could cause serious problems.

If you could, would you mind pack the test data and the test program
for me?  I could take a more careful look at it.

John


On 7/6/12 1:46 PM, Gaurav Agarwal wrote:
> Hi John,
> 
> I think I may have come across another problem - I issued a select
> query on ibis:table and then tried to issue another select query on
> the table returned from the first query. The second query on
> ibis::bord class seems to not return any result if I put any where
> condition. Am pasting the simple code snippet and the console output
> at log level 2. Please take a look at it sometime to see if I am doing
> something wrong.
> 
> cheers,
> gaurav
> 
> 
> #include <iostream>
> #include "ibis.h"
> 
> using namespace std;
> int main() {
>   ibis::gVerbose = 2;
>   ibis::init();
>   ibis::util::logger lg;
>   ibis::partList parts;
>   string s("/Users/gaurav/Downloads/ecpm");
>   ibis::table * table = ibis::table::create(s.c_str());
>   ibis::table* table_select = table->select("pub,site, sum(req)","(pub
> = 'redex') ");
>   table_select->dump(lg(), ",");
>   ibis::table::stringList cols = table_select->columnNames();
>   lg() << "~~~~~~~~~~~~~~~~~~~~~~~~~" <<endl;
>   lg() << cols;
>   ibis::table* table_select2 =
> table_select->select("pub,sum(_2)","(pub = 'redex') ");
>   table_select2->dump(lg(), ",");
>   delete table_select2;
>   delete table_select;
>   delete table;
> }
> 
> 
> Gauravs-MacBook-Pro:src gaurav$ ./a.out
> 
> FastBit ibis1.3.0.3
> Log messages started on Sat Jul  7 02:14:09 2012
> util::gatherParts -- examining /Users/gaurav/Downloads/ecpm
> index = <binning none/><encoding equality/>
> 
> Constructed a part named ecpm
> activeDir = "/Users/gaurav/Downloads/ecpm"
>   22005171 rows and 5 columns
> mensa -- constructed table T-ecpm (/Users/gaurav/Downloads/ecpm) from
> directory /Users/gaurav/Downloads/ecpm.  It consists of 1 partition
> with 5 columns and 22005171 rows
> countQuery::setWhereClause accepted new query conditions "pub == "redex""
> Constructed in-memory data partition wzb7L -- filter::sift2(SELECT
> pub,site, sum(req) FROM 1 data partition WHERE pub == ...) -- with 3
> columns
> filter::sift2(SELECT pub,site, sum(req) FROM 1 data partition WHERE
> pub == ...) -- processing data partition ecpm
> countQuery assigned data partition ecpm
> countQuery::evaluate -- Select count(*) From ecpm Where pub == "redex" --> 
> 2858
> countQuery::evaluate -- duration: 0.001297 sec(CPU), 0.001297 sec(elapsed)
> Constructed in-memory data partition _ARzQ -- GROUP BY pub, site,
> SUM(req) on table wzb7L -- with 2 rows and 3 columns
> filter::sift2(SELECT pub,site, sum(req) FROM 1 data partition WHERE
> pub == ...) -- duration: 0.23132 sec(CPU), 0.231337 sec(elapsed)
> countQuery::setWhereClause accepted new query conditions "pub == "redex""
> Constructed in-memory data partition wgrF1 -- filter::sift2(SELECT
> pub,sum(_2) FROM 1 data partition WHERE pub == ...) -- with 2 columns
> filter::sift2(SELECT pub,sum(_2) FROM 1 data partition WHERE pub ==
> ...) -- processing data partition _ARzQ
> countQuery assigned data partition _ARzQ
> countQuery::evaluate -- Select count(*) From _ARzQ Where pub == "redex" --> 0
> countQuery::evaluate -- duration: 3.4e-05 sec(CPU), 3.48091e-05 sec(elapsed)
> filter::sift2(SELECT pub,sum(_2) FROM 1 data partition WHERE pub ==
> ...) -- duration: 0.000129 sec(CPU), 0.000128984 sec(elapsed)
> "redex","Freezaholic",0
> "redex","vikingRDK",0
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> pubsite_2
> _______________________________________________
> FastBit-users mailing list
> [email protected]
> https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
> 

_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users

Reply via email to