I have run this query which involves a natural join between two partitions.
But the result I am getting is not the result that is expected. Can you
please explain what is wrong in the way I am executing this query.

1) ibis::part *tbl1 = new ibis::part part1("/fastbitdata/table1", 0, false);
2) ibis::part *tbl2 = new ibis::part part2("/fastbitdata/table2", 0, false);
3) ibis::column* col1= tbl1->getColumn("truckid");
4) ibis::column* col2= tbl2->getColumn("truckid");
5) ibis::fromClause frm = ibis::fromClause("from tbl1, tbl2");
6) ibis::selectClause sele =ibis::selectClause("count (*)");
7) ibis::selectClause* sel= &sele;
8) ibis::fromClause* fr = &frm;
9) ibis::jNatural *jn = new ibis::jNatural(tbl1, tbl2, col1,col2, 0,
10)std::cout << jn->count();

Both tbl1 and tbl2 consist only of 32 rows each and the column "truckid"
has same data in both tables. Therefore the join should have only 32 rows,
but it has 323 rows when executed.

It would be great if you could explain what I have done incorrectly here.

Thank you.
FastBit-users mailing list

Reply via email to