MAL: How to interate through group values?

Gatis Ozoliņš g.ozolins at scandicfusion.com
Wed Nov 30 08:18:44 CET 2016


I am trying to create my own MAL aggregate function.
I have implemented main function and it works OK:
function group_concat(b:bat[:oid, :str],s:bat[:oid, :str]):str;
       sep := "";
       barrier (h, t) := iterator.new(s);
           sep := t;
       exit (h, t);

       value := nil:str;
       barrier (h, t) := iterator.new(b);
              barrier bnormal := value;
                  value := value + sep;
                  value := value + t;
              exit bnormal;
              barrier bnil := calc.isnil(value);
                  value := t;
              exit bnil;
              redo (h, t) := iterator.next(b);
       exit (h, t);
       return value;
end group_concat;

Now I need to implemented subfunction with following definition:
function
subgroup_concat(b:bat[:oid,:str],s:bat[:oid,:str],g:bat[:oid,:oid],e:bat[:oid,:any_2],skip_nils:bit)
:bat[:oid,:str];


I can iterate over all groups g, but I can't find correct MAL function to
get all values (b,s) for this specific group.

Which MAL function would return list of oid for specific group g entry ?


Gatis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20161130/c8c9e1ad/attachment.html>


More information about the developers-list mailing list