Problems with aggregate UDF (subaggregate undefined error)
All, I have been able to create and install my own aggregate UDF (weightedpercentile), but when I try to execute it via mclient I am getting the following error: sql>select key, weightedpercentile(a,b) from t group by key; TypeException:user.s9_1[20]:'udf.subweightedpercentile' undefined in: X_34:bat[:any,:dbl] := udf.subweightedpercentile(X_26:bat[:oid,:dbl],X_33:bat[:oid,:dbl],X_16:bat[:oid,:oid],r1_16:bat[:oid,:oid],true:bit); program contains errors Does anyone know what I am doing incorrectly? I am at a total loss now. The error is almost identical to the error I get if I try to execute the corr() aggregate: sql>select key, corr(a,b) from t group by key; TypeException:user.s10_1[20]:'aggr.subcorr' undefined in: X_34:bat[:any,:dbl] := aggr.subcorr(X_26:bat[:oid,:dbl],X_33:bat[:oid,:dbl],X_16:bat[:oid,:oid],r1_16:bat[:oid,:oid],true:bit); program contains errors The corr() error is referenced in a recent bug submission (which I can't find in Bugzilla) If I look in the system function catalog, I see: sql>select * from sys.functions where name like '%weight%'; +------+--------------------+---------------------------------------------------+------+------+------+-------+-------+-------+------+ | id | name | func | mod | lang | type | side_ | varre | varar | sche | : : : : : uage : : effec : s : g : ma_i : : : : : : : : t : : : d : +======+====================+===================================================+======+======+======+=======+=======+=======+======+ | 9313 | weightedpercentile | -- weighted percentile | udf | 1 | 3 | false | false | false | 2000 | : : : create aggregate weightedpercentile(e1 real, e2 r : : : : : : : : : : : eal) returns real : : : : : : : : : : : external name udf.weightedpercentile; : : : : : : : : | 9318 | weightedpercentile | -- weighted percentile | udf | 1 | 3 | false | false | false | 2000 | : : : create aggregate weightedpercentile(e1 double, e2 : : : : : : : : : : : double) returns double : : : : : : : : : : : external name udf.weightedpercentile; : : : : : : : : +------+--------------------+---------------------------------------------------+------+------+------+-------+-------+-------+------+ 2 tuples (1.107ms) So my function appears to be installed. I have in (80_udf.sql): -- weighted percentile create aggregate weightedpercentile(e1 real, e2 real) returns real external name udf.weightedpercentile; -- weighted percentile create aggregate weightedpercentile(e1 double, e2 double) returns double external name udf.weightedpercentile; and in (udf.mal): # BAT MAL signatures module batudf; command weightedpercentile(one:bat[:oid,:bte],two:bat[:oid,:bte]):lng address UDFBATweightedpercentile comment "compute the weighted percentile (bte)" command weightedpercentile(one:bat[:oid,:int],two:bat[:oid,:int]):lng address UDFBATweightedpercentile comment "compute the weighted percentile (int)" command weightedpercentile(one:bat[:oid,:lng],two:bat[:oid,:lng]):lng address UDFBATweightedpercentile comment "compute the weighted percentile (lng)"
https://www.monetdb.org/bugzilla/show_bug.cgi?id=3978
On Sun, May 1, 2016 at 9:50 PM, Anderson, David B wrote: All, I have been able to create and install my own aggregate UDF
(weightedpercentile), but when I try to execute it via mclient I am getting
the following error: sql>select key, weightedpercentile(a,b) from t group by key;
TypeException:user.s9_1[20]:'udf.subweightedpercentile' undefined in:
X_34:bat[:any,:dbl] :=
udf.subweightedpercentile(X_26:bat[:oid,:dbl],X_33:bat[:oid,:dbl],X_16:bat[:oid,:oid],r1_16:bat[:oid,:oid],true:bit);
program contains errors Does anyone know what I am doing incorrectly? I am at a total loss now. The error is almost identical to the error I get if I try to execute the
corr() aggregate: sql>select key, corr(a,b) from t group by key;
TypeException:user.s10_1[20]:'aggr.subcorr' undefined in:
X_34:bat[:any,:dbl] :=
aggr.subcorr(X_26:bat[:oid,:dbl],X_33:bat[:oid,:dbl],X_16:bat[:oid,:oid],r1_16:bat[:oid,:oid],true:bit);
program contains errors The corr() error is referenced in a recent bug submission (which I can't
find in Bugzilla) If I look in the system function catalog, I see: sql>select * from sys.functions where name like '%weight%'; +------+--------------------+---------------------------------------------------+------+------+------+-------+-------+-------+------+
| id | name | func
| mod | lang | type | side_ | varre | varar | sche |
: : :
: : uage : : effec : s : g : ma_i :
: : :
: : : : t : : : d : +======+====================+===================================================+======+======+======+=======+=======+=======+======+
| 9313 | weightedpercentile | -- weighted percentile
| udf | 1 | 3 | false | false | false | 2000 |
: : : create aggregate weightedpercentile(e1 real,
e2 r : : : : : : : :
: : : eal) returns real
: : : : : : : :
: : : external name
udf.weightedpercentile; : : : : : : :
:
| 9318 | weightedpercentile | -- weighted percentile
| udf | 1 | 3 | false | false | false | 2000 |
: : : create aggregate weightedpercentile(e1
double, e2 : : : : : : : :
: : : double) returns double
: : : : : : : :
: : : external name
udf.weightedpercentile; : : : : : : :
: +------+--------------------+---------------------------------------------------+------+------+------+-------+-------+-------+------+
2 tuples (1.107ms) So my function appears to be installed. I have in (80_udf.sql): -- weighted percentile
create aggregate weightedpercentile(e1 real, e2 real) returns real
external name udf.weightedpercentile; -- weighted percentile
create aggregate weightedpercentile(e1 double, e2 double) returns double
external name udf.weightedpercentile; and in (udf.mal): # BAT MAL signatures
module batudf; command weightedpercentile(one:bat[:oid,:bte],two:bat[:oid,:bte]):lng
address UDFBATweightedpercentile
comment "compute the weighted percentile (bte)" command weightedpercentile(one:bat[:oid,:int],two:bat[:oid,:int]):lng
address UDFBATweightedpercentile
comment "compute the weighted percentile (int)" command weightedpercentile(one:bat[:oid,:lng],two:bat[:oid,:lng]):lng
address UDFBATweightedpercentile
comment "compute the weighted percentile (lng)" _______________________________________________
users-list mailing list
users-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/users-list
The patch refers to the "(not so) new sub* interface" is this compatible with aggregate UDFs? Can someone point me at a simple example? I was looking at the C-code and I am not sure how to proceed.
The existing UDF examples are fairly high level, but the sub* interface appears to require more detailed knowledge of the MonetDB internals.
-----Original Message-----
From: Anthony Damico [ajdamico@gmail.commailto:ajdamico@gmail.com]
Sent: Monday, May 02, 2016 02:21 AM Eastern Standard Time
To: Communication channel for MonetDB users
Subject: Re: Problems with aggregate UDF (subaggregate undefined error)
https://www.monetdb.org/bugzilla/show_bug.cgi?id=3978https://urldefense.proofpoint.com/v2/url?u=https-3A__www.monetdb.org_bugzilla_show-5Fbug.cgi-3Fid-3D3978&d=CwMGaQ&c=j-EkbjBYwkAB4f8ZbVn1Fw&r=8_GYjk1edsyLJlNaxMxYxBJsviF3JXYvwDK42uy5KWU&m=Dz5aBnsozeq3aJ57KDoHgk5TEAJBPWkVMFtRKyNRBaQ&s=8my2AKIArjKmmOAcy2ziJDvu9p1PYvFgqPFcGku70Io&e=
On Sun, May 1, 2016 at 9:50 PM, Anderson, David B
More precisely: it looks like I need to add code to gdk/gdk_aggr.c, but isn’t that the kernel implementation? It seems too invasive.
Any guidance would be greatly appreciated.
BTW – Thank you for all the work on MonetDB. The raw speed out of the box is really impressive. One of my instances is performing similarly to a dedicated Netezza box for heavy duty aggregates/computations.
Thanks,
Dave
From: Anderson, David B [ICG-MKTS]
Sent: Monday, May 02, 2016 8:23 AM
To: 'Communication channel for MonetDB users'; 'Communication channel for MonetDB users'
Subject: RE: Problems with aggregate UDF (subaggregate undefined error)
The patch refers to the "(not so) new sub* interface" is this compatible with aggregate UDFs? Can someone point me at a simple example? I was looking at the C-code and I am not sure how to proceed.
The existing UDF examples are fairly high level, but the sub* interface appears to require more detailed knowledge of the MonetDB internals.
-----Original Message-----
From: Anthony Damico [ajdamico@gmail.commailto:ajdamico@gmail.com]
Sent: Monday, May 02, 2016 02:21 AM Eastern Standard Time
To: Communication channel for MonetDB users
Subject: Re: Problems with aggregate UDF (subaggregate undefined error)
https://www.monetdb.org/bugzilla/show_bug.cgi?id=3978https://urldefense.proofpoint.com/v2/url?u=https-3A__www.monetdb.org_bugzilla_show-5Fbug.cgi-3Fid-3D3978&d=CwMGaQ&c=j-EkbjBYwkAB4f8ZbVn1Fw&r=8_GYjk1edsyLJlNaxMxYxBJsviF3JXYvwDK42uy5KWU&m=Dz5aBnsozeq3aJ57KDoHgk5TEAJBPWkVMFtRKyNRBaQ&s=8my2AKIArjKmmOAcy2ziJDvu9p1PYvFgqPFcGku70Io&e=
On Sun, May 1, 2016 at 9:50 PM, Anderson, David B
participants (2)
-
Anderson, David B
-
Anthony Damico