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