group_concat

Stefan Manegold Stefan.Manegold at cwi.nl
Thu Dec 13 15:29:22 CET 2012


Tapomay,

thanks for the enlightment!
Knowing what you are actually after helps us a lot to give you better advice how to approach your goal, than merely being able to answer individual specific questions without having/knowing the complete contexts.

I cannot quickly answer your question right now, but I have one more general comment / advice.

Not only is Mx to be phased out, but also the aggregation code structure in monetdb5/modules/kernel/aggr*.mx in the Oct2012 release branch is obsolete.

For a complete re-implementation of aggregation functions using a largely simplified coding style in plain C (rather than Mx) is available in monetdb5/modules/kernel/aggr.{c,mal{.sh}} in the Feb2013 release candidate branch and the default development branch.

You might also want to check that code for examples and inspiration.

Best,
Stefan

22:36:31 manegold at rome:/tmp $ cat /tmp/xyz 
Tapomay,

thanks for the enlightment!
Knowing what you are actually after helps us a lot to give you better advice how to approach your goal, than merely being able to answer individual specific questions without having/knowing the complete contexts.

Having said that, the aggregation code structure in monetdb5/modules/kernel/aggr*.mx in the Oct2012 release branch is also obsolete.

For a complete re-implementation of aggregations functions using a largely simplified coding style in plain C (rather than Mx) is available in monetdb5/modules/kernel/aggr.{c,mal{.sh}} in the Feb2013 release candidate branch and the default development branch.
Please check this code 

----- Original Message -----
> Almost there.
> As suggested by Fabian in the following thread I gave up the MX file
> approach and implemented group_concat as UDF in C.
> http://sourceforge.net/mailarchive/forum.php?thread_name=mailman.243.1355328304.1624.developers-list%40monetdb.org&forum_name=monetdb-developers
> 
> 
> When I try to conclude my function UDFBATgroup_concat_(BAT **ret, BAT
> *b, BAT *g, BAT *h, FILE* fp) //ignore fp
> as follows:
> 
> BATaccessBegin(h, USE_HEAD | USE_TAIL, MMAP_SEQUENTIAL);
> index = 0;
> BATloop(h, p, q)
> {
> ptr hhead = BUNhead(hi, p);
> fprintf(fp, "%d: hhead=%d", index, hhead);
> str dst = tailValArray[index];
> fprintf(fp, "%d: dstStr=%s# ", index, dst);
> 
> BUNins(bn, hhead, dst, FALSE);
> fprintf(fp, "%d: Insert complete\n", index);
> index++;
> }
> 
> I get the following error on the client terminal
> [tapomay at tapomay-laptop monetdata]$ echo "select house,
> group_concat(name) from gs group by house;" | mclient -d tapomay
> GDKerror:!ERROR: BUNins: access denied to tmp_10162, aborting.
> BUNins: access denied to tmp_10162, aborting.
> BUNins: access denied to tmp_10162, aborting.
> 
> The groupings are ready in the tailVarArray.
> 
> NEED HELP.
> Thanks and Regards,
> Tapomay.
> _______________________________________________
> developers-list mailing list
> developers-list at monetdb.org
> http://mail.monetdb.org/mailman/listinfo/developers-list
> 
_______________________________________________
developers-list mailing list
developers-list at monetdb.org
http://mail.monetdb.org/mailman/listinfo/developers-list


More information about the developers-list mailing list