group_concat in MAL not working due to algebra.uselect
Hi, Last year, I was looking for the MAL definition of group_concat and Nik Schuiling gave me the MAL definition which is below. We compile MonetDB from source and this definition was working on MonetDB-11.19.9 (Oct2014-SP2). Since this version, there has been a number of newer versions of MonetDB. So, I was trying to upgrade our system to the latest version of MonetDB (11.21.13). After the installation of the newer version, I ran: select "DataSetId", group_concat("FieldName") from datasetmarkermeta group by "DataSetId"; from mclient interface and got the following error message: TypeException:kddart.subgroup_concat[5]:'algebra.uselect' undefined in: TIDs:any := algebra.uselect(g:bat[:oid,:oid],grpid:oid); MALException:kddart.subgroup_concat[0]:Error in cloned function TypeException:user.s2_1[15]:'kddart.subgroup_concat' undefined in: X_27:bat[:oid,:str] := kddart.subgroup_concat(X_26:bat[:oid,:str],X_16:bat[:oid,:oid],r1_16:bat[:oid,:oid],true:bit); program contains errors It says algebra.uselect function is not defined. How do I fix this problem? group_concat MAL definition start ------------------------------------------- module kddart; command group_concat(b:bat[:oid,:str]):str address KDDARTgroup_concat comment "Mal kddart"; function group_concat(b:bat[:oid, :str]):str; value := ""; barrier (h, t) := iterator.new(b); value := value + t; value := value + ""; redo (h, t) := iterator.next(b); exit (h, t); return value; end group_concat; function subgroup_concat(b:bat[:oid,:any_1],g:bat[:oid,:oid],e:bat[:oid,:any_2],skip_nils:bit) :bat[:oid,:str]; nw := aggr.count(e); nl := calc.lng(nw); bn := bat.new(:oid, :str, nl); # check 'e' has some values - this is the list of group IDs in the head # 'g' is the group to the data BAT head ID mapping # 'b' is the data column BAT that we are aggregating over barrier (grpid, t) := iterator.new(e); # select GID from TID->GID map to get matching TIDs TIDs := algebra.uselect(g,grpid); # get DATA for matching TIDs b_data := algebra.kintersect(b,TIDs); # aggregate grpval := group_concat(b_data); # Store the result for this group bat.insert(bn, grpid, grpval); redo (grpid, t) := iterator.next(e); exit (grpid, t); return bn; end subgroup_concat;
hi, did this thread ever get resolved? functions like GROUP_CONCAT() seem
like a useful extension of
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/UserDefinedFuncti...
since they are available in other databases[1][2] and many of us already
know the expected behavior. i'm a little scared of implementing myself
since i think the finale will require a windows build rollercoaster [3] for
me.
just thinking out loud..curious if anyone has thoughts or advice. thanks!
[1] mysql docs:
http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html#function_grou...
[2] sqlite docs: https://www.sqlite.org/lang_aggfunc.html
[3]
http://dev.monetdb.org/hg/MonetDB/file/tip/buildtools/doc/windowsbuild.rst
On Fri, Feb 5, 2016 at 1:18 AM, Puthick Hok
Hi,
Last year, I was looking for the MAL definition of group_concat and Nik Schuiling gave me the MAL definition which is below.
We compile MonetDB from source and this definition was working on MonetDB-11.19.9 (Oct2014-SP2). Since this version, there has been a number of newer versions of MonetDB. So, I was trying to upgrade our system to the latest version of MonetDB (11.21.13). After the installation of the newer version, I ran:
select "DataSetId", group_concat("FieldName") from datasetmarkermeta group by "DataSetId";
from mclient interface and got the following error message:
TypeException:kddart.subgroup_concat[5]:'algebra.uselect' undefined in: TIDs:any := algebra.uselect(g:bat[:oid,:oid],grpid:oid); MALException:kddart.subgroup_concat[0]:Error in cloned function TypeException:user.s2_1[15]:'kddart.subgroup_concat' undefined in: X_27:bat[:oid,:str] :=
kddart.subgroup_concat(X_26:bat[:oid,:str],X_16:bat[:oid,:oid],r1_16:bat[:oid,:oid],true:bit); program contains errors
It says algebra.uselect function is not defined. How do I fix this problem?
group_concat MAL definition start -------------------------------------------
module kddart;
command group_concat(b:bat[:oid,:str]):str address KDDARTgroup_concat comment "Mal kddart";
function group_concat(b:bat[:oid, :str]):str;
value := "";
barrier (h, t) := iterator.new(b);
value := value + t;
value := value + "";
redo (h, t) := iterator.next(b);
exit (h, t);
return value;
end group_concat;
function subgroup_concat(b:bat[:oid,:any_1],g:bat[:oid,:oid],e:bat[:oid,:any_2],skip_nils:bit) :bat[:oid,:str];
nw := aggr.count(e);
nl := calc.lng(nw);
bn := bat.new(:oid, :str, nl);
# check 'e' has some values - this is the list of group IDs in the head
# 'g' is the group to the data BAT head ID mapping
# 'b' is the data column BAT that we are aggregating over
barrier (grpid, t) := iterator.new(e);
# select GID from TID->GID map to get matching TIDs
TIDs := algebra.uselect(g,grpid);
# get DATA for matching TIDs
b_data := algebra.kintersect(b,TIDs);
# aggregate
grpval := group_concat(b_data);
# Store the result for this group
bat.insert(bn, grpid, grpval);
redo (grpid, t) := iterator.next(e);
exit (grpid, t);
return bn;
end subgroup_concat; _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
Hi Anthony,
Thank you very much for your reply. It will be good for us if
group_concat is supported.
Thanks,
Puthick
On Sat, Jun 4, 2016 at 7:25 PM, Anthony Damico
hi, did this thread ever get resolved? functions like GROUP_CONCAT() seem like a useful extension of
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/UserDefinedFuncti...
since they are available in other databases[1][2] and many of us already know the expected behavior. i'm a little scared of implementing myself since i think the finale will require a windows build rollercoaster [3] for me.
just thinking out loud..curious if anyone has thoughts or advice. thanks!
[1] mysql docs: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html#function_grou... [2] sqlite docs: https://www.sqlite.org/lang_aggfunc.html [3] http://dev.monetdb.org/hg/MonetDB/file/tip/buildtools/doc/windowsbuild.rst
On Fri, Feb 5, 2016 at 1:18 AM, Puthick Hok
wrote: Hi,
Last year, I was looking for the MAL definition of group_concat and Nik Schuiling gave me the MAL definition which is below.
We compile MonetDB from source and this definition was working on MonetDB-11.19.9 (Oct2014-SP2). Since this version, there has been a number of newer versions of MonetDB. So, I was trying to upgrade our system to the latest version of MonetDB (11.21.13). After the installation of the newer version, I ran:
select "DataSetId", group_concat("FieldName") from datasetmarkermeta group by "DataSetId";
from mclient interface and got the following error message:
TypeException:kddart.subgroup_concat[5]:'algebra.uselect' undefined in: TIDs:any := algebra.uselect(g:bat[:oid,:oid],grpid:oid); MALException:kddart.subgroup_concat[0]:Error in cloned function TypeException:user.s2_1[15]:'kddart.subgroup_concat' undefined in: X_27:bat[:oid,:str] :=
kddart.subgroup_concat(X_26:bat[:oid,:str],X_16:bat[:oid,:oid],r1_16:bat[:oid,:oid],true:bit); program contains errors
It says algebra.uselect function is not defined. How do I fix this problem?
group_concat MAL definition start -------------------------------------------
module kddart;
command group_concat(b:bat[:oid,:str]):str address KDDARTgroup_concat comment "Mal kddart";
function group_concat(b:bat[:oid, :str]):str;
value := "";
barrier (h, t) := iterator.new(b);
value := value + t;
value := value + "";
redo (h, t) := iterator.next(b);
exit (h, t);
return value;
end group_concat;
function subgroup_concat(b:bat[:oid,:any_1],g:bat[:oid,:oid],e:bat[:oid,:any_2],skip_nils:bit) :bat[:oid,:str];
nw := aggr.count(e);
nl := calc.lng(nw);
bn := bat.new(:oid, :str, nl);
# check 'e' has some values - this is the list of group IDs in the head
# 'g' is the group to the data BAT head ID mapping
# 'b' is the data column BAT that we are aggregating over
barrier (grpid, t) := iterator.new(e);
# select GID from TID->GID map to get matching TIDs
TIDs := algebra.uselect(g,grpid);
# get DATA for matching TIDs
b_data := algebra.kintersect(b,TIDs);
# aggregate
grpval := group_concat(b_data);
# Store the result for this group
bat.insert(bn, grpid, grpval);
redo (grpid, t) := iterator.next(e);
exit (grpid, t);
return bn;
end subgroup_concat; _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
hi puthick, i don't know that it would be officially supported within the
core software? but functions commonly used in other databases seem like a
smart way to add to the monetdb documentation. depending on how far you
got, perhaps users like you and i could submit our own tutorial or techdoc
contribution to the monetdb team without asking too much of their time..
On Sat, Jun 4, 2016 at 8:23 AM, Puthick Hok
Hi Anthony,
Thank you very much for your reply. It will be good for us if group_concat is supported.
Thanks, Puthick
On Sat, Jun 4, 2016 at 7:25 PM, Anthony Damico
wrote: hi, did this thread ever get resolved? functions like GROUP_CONCAT() seem like a useful extension of
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/UserDefinedFuncti...
since they are available in other databases[1][2] and many of us already know the expected behavior. i'm a little scared of implementing myself since i think the finale will require a windows build rollercoaster [3]
me.
just thinking out loud..curious if anyone has thoughts or advice.
for thanks!
[1] mysql docs:
http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html#function_grou...
[2] sqlite docs: https://www.sqlite.org/lang_aggfunc.html [3]
http://dev.monetdb.org/hg/MonetDB/file/tip/buildtools/doc/windowsbuild.rst
On Fri, Feb 5, 2016 at 1:18 AM, Puthick Hok
wrote: Hi,
Last year, I was looking for the MAL definition of group_concat and Nik Schuiling gave me the MAL definition which is below.
We compile MonetDB from source and this definition was working on MonetDB-11.19.9 (Oct2014-SP2). Since this version, there has been a number of newer versions of MonetDB. So, I was trying to upgrade our system to the latest version of MonetDB (11.21.13). After the installation of the newer version, I ran:
select "DataSetId", group_concat("FieldName") from datasetmarkermeta group by "DataSetId";
from mclient interface and got the following error message:
TypeException:kddart.subgroup_concat[5]:'algebra.uselect' undefined in: TIDs:any := algebra.uselect(g:bat[:oid,:oid],grpid:oid); MALException:kddart.subgroup_concat[0]:Error in cloned function TypeException:user.s2_1[15]:'kddart.subgroup_concat' undefined in: X_27:bat[:oid,:str] :=
program contains errors
It says algebra.uselect function is not defined. How do I fix this problem?
group_concat MAL definition start -------------------------------------------
module kddart;
command group_concat(b:bat[:oid,:str]):str address KDDARTgroup_concat comment "Mal kddart";
function group_concat(b:bat[:oid, :str]):str;
value := "";
barrier (h, t) := iterator.new(b);
value := value + t;
value := value + "";
redo (h, t) := iterator.next(b);
exit (h, t);
return value;
end group_concat;
function
subgroup_concat(b:bat[:oid,:any_1],g:bat[:oid,:oid],e:bat[:oid,:any_2],skip_nils:bit)
:bat[:oid,:str];
nw := aggr.count(e);
nl := calc.lng(nw);
bn := bat.new(:oid, :str, nl);
# check 'e' has some values - this is the list of group IDs in
kddart.subgroup_concat(X_26:bat[:oid,:str],X_16:bat[:oid,:oid],r1_16:bat[:oid,:oid],true:bit); the
head
# 'g' is the group to the data BAT head ID mapping
# 'b' is the data column BAT that we are aggregating over
barrier (grpid, t) := iterator.new(e);
# select GID from TID->GID map to get matching TIDs
TIDs := algebra.uselect(g,grpid);
# get DATA for matching TIDs
b_data := algebra.kintersect(b,TIDs);
# aggregate
grpval := group_concat(b_data);
# Store the result for this group
bat.insert(bn, grpid, grpval);
redo (grpid, t) := iterator.next(e);
exit (grpid, t);
return bn;
end subgroup_concat; _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
participants (2)
-
Anthony Damico
-
Puthick Hok