[Monetdb-developers] group by on BATs

Hi, I have three BATs and I would like to create groups of pairs from the first two BATs and take the bitwise and for the tail values of each group according to the third BAT. I saw that there is a module for grouping operations in monetdb5/modules/kernel/group.mx. Is it the right one for my purpose? For the case of bitwise and is there any function that I could use or I should write my own like for example the GRPaggr_count() function in that file. Thanks, Babis

Hi, after all the 'group' module did the work for me. As for the bitwise AND aggregate I ended up writing it modifying the sum aggregate of the 'aggr' module which has been implemented by Stefan. After completion of the implementation of the bitwise AND aggregate I noticed the comments at the beginning of the respective file (monetdb5/modules/kernel/aggr.mx) which instruct the developer to store the routines in the 'group' module. I also noticed (if I am not mistaken) that the 'group' module has its own implementation for sum, avg, etc. aggregates and does not reuse that of the 'aggr' module. Why is that? Has the 'aggr' module been deprecated? I also noticed that the produced mal code for the following SQL queries uses the 'aggr' instead of the 'group' module. EXPLAIN SELECT i, j, count(k) FROM foo GROUP BY i, j; EXPLAIN SELECT i, j, sum(k) FROM foo GROUP BY i, j; And a side question that pertains to GDK development and my understanding of BBP management: Suppose that I need to make a BAT computation that can be expressed with nested BAT operations like for example the following BATop_x(BATop_y(BATop_w(aBAT), BATop_k(bBAT)), BATop_z(cBAT)) If I am not mistaken, the intermediate BATs will still be pinned in BBP after completion of BATop_x execution and in general "for ever". If it is so, those kind of expressions are discouraged? Thanks, Babis On Fri, Dec 30, 2011 at 1:23 PM, Charalampos Nikolaou <charnik@di.uoa.gr> wrote:
Hi,
I have three BATs and I would like to create groups of pairs from the first two BATs and take the bitwise and for the tail values of each group according to the third BAT. I saw that there is a module for grouping operations in monetdb5/modules/kernel/group.mx. Is it the right one for my purpose? For the case of bitwise and is there any function that I could use or I should write my own like for example the GRPaggr_count() function in that file.
Thanks, Babis
participants (1)
-
Charalampos Nikolaou