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.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=3978

 

On Sun, May 1, 2016 at 9:50 PM, Anderson, David B <david.b.anderson@citi.com> 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