Line data Source code
1 : /*
2 : * SPDX-License-Identifier: MPL-2.0
3 : *
4 : * This Source Code Form is subject to the terms of the Mozilla Public
5 : * License, v. 2.0. If a copy of the MPL was not distributed with this
6 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 : *
8 : * Copyright 2024 MonetDB Foundation;
9 : * Copyright August 2008 - 2023 MonetDB B.V.;
10 : * Copyright 1997 - July 2008 CWI.
11 : */
12 :
13 : #include "monetdb_config.h"
14 : #include "mal.h"
15 : #include "mal_exception.h"
16 : #include "aggr.h"
17 :
18 : /*
19 : * grouped aggregates
20 : */
21 : static str
22 36860 : AGGRgrouped_bat_or_val(bat *retval1, bat *retval2, const bat *bid,
23 : const bat *gid, const bat *eid, const bat *sid,
24 : bool skip_nils, int scale, int tp,
25 : BAT *(*grpfunc1)(BAT *, BAT *, BAT *, BAT *, int, bool),
26 : gdk_return(*grpfunc2)(BAT **, BAT **, BAT *, BAT *,
27 : BAT *, BAT *, int, bool, int),
28 : BAT * (*quantilefunc)(BAT *, BAT *, BAT *, BAT *, int,
29 : double, bool), const bat *quantile,
30 : const double *quantile_val, const char *malfunc)
31 : {
32 36860 : BAT *b, *g = NULL, *e = NULL, *s = NULL, *bn = NULL, *cnts = NULL, *q = NULL;
33 36860 : double qvalue;
34 :
35 : /* exactly one of grpfunc1, grpfunc2 and quantilefunc is non-NULL */
36 36860 : assert((grpfunc1 != NULL) + (grpfunc2 != NULL) + (quantilefunc != NULL) == 1);
37 :
38 : /* if retval2 is non-NULL, we must have grpfunc2 */
39 36860 : assert(retval2 == NULL || grpfunc2 != NULL);
40 : /* only quantiles need a quantile BAT */
41 36860 : assert((quantilefunc == NULL) == (quantile == NULL && quantile_val == NULL));
42 :
43 36860 : b = BATdescriptor(*bid);
44 36902 : if (b == NULL ||
45 36902 : (gid && !is_bat_nil(*gid) && (g = BATdescriptor(*gid)) == NULL) ||
46 36929 : (eid && !is_bat_nil(*eid) && (e = BATdescriptor(*eid)) == NULL) ||
47 36928 : (sid && !is_bat_nil(*sid) && (s = BATdescriptor(*sid)) == NULL) ||
48 21 : (quantile && !is_bat_nil(*quantile) && (q = BATdescriptor(*quantile)) == NULL)) {
49 0 : BBPreclaim(b);
50 0 : BBPreclaim(g);
51 0 : BBPreclaim(e);
52 0 : BBPreclaim(s);
53 0 : BBPreclaim(q);
54 0 : throw(MAL, malfunc, SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
55 : }
56 36928 : if (tp == TYPE_any &&
57 43 : (grpfunc1 == BATgroupmedian ||
58 40 : grpfunc1 == BATgroupmedian_avg ||
59 3 : quantilefunc == BATgroupquantile ||
60 : quantilefunc == BATgroupquantile_avg))
61 72 : tp = b->ttype;
62 :
63 36928 : if (grpfunc1) {
64 36569 : bn = (*grpfunc1) (b, g, e, s, tp, skip_nils);
65 359 : } else if (quantilefunc) {
66 40 : if (!quantile_val) {
67 22 : assert(BATcount(q) > 0 || BATcount(b) == 0);
68 22 : assert(q->ttype == TYPE_dbl);
69 22 : if (BATcount(q) == 0) {
70 : qvalue = 0.5;
71 : } else {
72 19 : MT_lock_set(&q->theaplock);
73 19 : qvalue = ((const dbl *) Tloc(q, 0))[0];
74 19 : MT_lock_unset(&q->theaplock);
75 19 : if (qvalue < 0 || qvalue > 1) {
76 6 : BBPunfix(b->batCacheid);
77 6 : BBPreclaim(g);
78 6 : BBPreclaim(e);
79 6 : BBPreclaim(s);
80 6 : BBPunfix(q->batCacheid);
81 6 : throw(MAL, malfunc,
82 : "quantile value of %f is not in range [0,1]", qvalue);
83 : }
84 : }
85 16 : BBPunfix(q->batCacheid);
86 : } else {
87 18 : qvalue = *(quantile_val);
88 : }
89 34 : bn = (*quantilefunc) (b, g, e, s, tp, qvalue, skip_nils);
90 449 : } else if ((*grpfunc2) (&bn, retval2 ? &cnts : NULL, b, g, e, s, tp,
91 : skip_nils, scale) != GDK_SUCCEED) {
92 0 : bn = NULL;
93 : }
94 :
95 36879 : BBPunfix(b->batCacheid);
96 36896 : BBPreclaim(g);
97 36927 : BBPreclaim(e);
98 36924 : BBPreclaim(s);
99 36920 : if (bn == NULL)
100 4 : throw(MAL, malfunc, GDK_EXCEPTION);
101 36916 : *retval1 = bn->batCacheid;
102 36916 : BBPkeepref(bn);
103 36891 : if (retval2) {
104 189 : *retval2 = cnts->batCacheid;
105 189 : BBPkeepref(cnts);
106 : }
107 : return MAL_SUCCEED;
108 : }
109 :
110 : static str
111 36869 : AGGRgrouped(bat *retval1, bat *retval2, const bat *bid, const bat *gid,
112 : const bat *eid, const bat *sid, bool skip_nils, int scale, int tp,
113 : BAT *(*grpfunc1)(BAT *, BAT *, BAT *, BAT *, int, bool),
114 : gdk_return(*grpfunc2)(BAT **, BAT **, BAT *, BAT *, BAT *, BAT *,
115 : int, bool, int), BAT * (*quantilefunc)(BAT *,
116 : BAT *,
117 : BAT *,
118 : BAT *,
119 : int,
120 : double,
121 : bool),
122 : const bat *quantile, const char *malfunc)
123 : {
124 36869 : return AGGRgrouped_bat_or_val(retval1, retval2, bid, gid, eid, sid,
125 : skip_nils, scale, tp, grpfunc1, grpfunc2,
126 : quantilefunc, quantile, NULL, malfunc);
127 : }
128 :
129 : static str
130 0 : AGGRsum3_bte(bat *retval, const bat *bid, const bat *gid, const bat *eid)
131 : {
132 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_bte,
133 : BATgroupsum, NULL, NULL, NULL, "aggr.sum");
134 : }
135 :
136 : static str
137 0 : AGGRsum3_sht(bat *retval, const bat *bid, const bat *gid, const bat *eid)
138 : {
139 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_sht,
140 : BATgroupsum, NULL, NULL, NULL, "aggr.sum");
141 : }
142 :
143 : static str
144 0 : AGGRsum3_int(bat *retval, const bat *bid, const bat *gid, const bat *eid)
145 : {
146 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_int,
147 : BATgroupsum, NULL, NULL, NULL, "aggr.sum");
148 : }
149 :
150 : str
151 0 : AGGRsum3_lng(bat *retval, const bat *bid, const bat *gid, const bat *eid)
152 : {
153 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_lng,
154 : BATgroupsum, NULL, NULL, NULL, "aggr.sum");
155 : }
156 :
157 : #ifdef HAVE_HGE
158 : str
159 0 : AGGRsum3_hge(bat *retval, const bat *bid, const bat *gid, const bat *eid)
160 : {
161 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_hge,
162 : BATgroupsum, NULL, NULL, NULL, "aggr.sum");
163 : }
164 : #endif
165 :
166 : static str
167 0 : AGGRsum3_flt(bat *retval, const bat *bid, const bat *gid, const bat *eid)
168 : {
169 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_flt,
170 : BATgroupsum, NULL, NULL, NULL, "aggr.sum");
171 : }
172 :
173 : static str
174 0 : AGGRsum3_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid)
175 : {
176 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_dbl,
177 : BATgroupsum, NULL, NULL, NULL, "aggr.sum");
178 : }
179 :
180 : static str
181 0 : AGGRprod3_bte(bat *retval, const bat *bid, const bat *gid, const bat *eid)
182 : {
183 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_bte,
184 : BATgroupprod, NULL, NULL, NULL, "aggr.prod");
185 : }
186 :
187 : static str
188 0 : AGGRprod3_sht(bat *retval, const bat *bid, const bat *gid, const bat *eid)
189 : {
190 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_sht,
191 : BATgroupprod, NULL, NULL, NULL, "aggr.prod");
192 : }
193 :
194 : static str
195 0 : AGGRprod3_int(bat *retval, const bat *bid, const bat *gid, const bat *eid)
196 : {
197 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_int,
198 : BATgroupprod, NULL, NULL, NULL, "aggr.prod");
199 : }
200 :
201 : static str
202 0 : AGGRprod3_lng(bat *retval, const bat *bid, const bat *gid, const bat *eid)
203 : {
204 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_lng,
205 : BATgroupprod, NULL, NULL, NULL, "aggr.prod");
206 : }
207 :
208 : #ifdef HAVE_HGE
209 : static str
210 0 : AGGRprod3_hge(bat *retval, const bat *bid, const bat *gid, const bat *eid)
211 : {
212 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_hge,
213 : BATgroupprod, NULL, NULL, NULL, "aggr.prod");
214 : }
215 : #endif
216 :
217 : static str
218 0 : AGGRprod3_flt(bat *retval, const bat *bid, const bat *gid, const bat *eid)
219 : {
220 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_flt,
221 : BATgroupprod, NULL, NULL, NULL, "aggr.prod");
222 : }
223 :
224 : static str
225 0 : AGGRprod3_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid)
226 : {
227 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_dbl,
228 : BATgroupprod, NULL, NULL, NULL, "aggr.prod");
229 : }
230 :
231 : static str
232 0 : AGGRavg13_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid)
233 : {
234 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_dbl,
235 : NULL, BATgroupavg, NULL, NULL, "aggr.avg");
236 : }
237 :
238 : static str
239 0 : AGGRavg23_dbl(bat *retval1, bat *retval2, const bat *bid, const bat *gid,
240 : const bat *eid)
241 : {
242 0 : return AGGRgrouped(retval1, retval2, bid, gid, eid, NULL, true, 0, TYPE_dbl,
243 : NULL, BATgroupavg, NULL, NULL, "aggr.avg");
244 : }
245 :
246 : static str
247 0 : AGGRavg14_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid,
248 : int *scale)
249 : {
250 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, *scale,
251 : TYPE_dbl, NULL, BATgroupavg, NULL, NULL, "aggr.avg");
252 : }
253 :
254 : static str
255 0 : AGGRavg24_dbl(bat *retval1, bat *retval2, const bat *bid, const bat *gid,
256 : const bat *eid, int *scale)
257 : {
258 0 : return AGGRgrouped(retval1, retval2, bid, gid, eid, NULL, true, *scale,
259 : TYPE_dbl, NULL, BATgroupavg, NULL, NULL, "aggr.avg");
260 : }
261 :
262 : static str
263 0 : AGGRstdev3_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid)
264 : {
265 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_dbl,
266 : BATgroupstdev_sample, NULL, NULL, NULL, "aggr.stdev");
267 : }
268 :
269 : static str
270 0 : AGGRstdevp3_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid)
271 : {
272 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_dbl,
273 : BATgroupstdev_population, NULL, NULL, NULL,
274 : "aggr.stdevp");
275 : }
276 :
277 : static str
278 0 : AGGRvariance3_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid)
279 : {
280 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_dbl,
281 : BATgroupvariance_sample, NULL, NULL, NULL,
282 : "aggr.variance");
283 : }
284 :
285 : static str
286 0 : AGGRvariancep3_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid)
287 : {
288 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_dbl,
289 : BATgroupvariance_population, NULL, NULL, NULL,
290 : "aggr.variancep");
291 : }
292 :
293 : static str
294 0 : AGGRcount3(bat *retval, const bat *bid, const bat *gid, const bat *eid,
295 : const bit *ignorenils)
296 : {
297 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *ignorenils, 0,
298 : TYPE_lng, BATgroupcount, NULL, NULL, NULL, "aggr.count");
299 : }
300 :
301 : static str
302 0 : AGGRcount3nonils(bat *retval, const bat *bid, const bat *gid, const bat *eid)
303 : {
304 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, true, 0, TYPE_lng,
305 : BATgroupcount, NULL, NULL, NULL, "aggr.count");
306 : }
307 :
308 : static str
309 0 : AGGRcount3nils(bat *retval, const bat *bid, const bat *gid, const bat *eid)
310 : {
311 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, false, 0, TYPE_lng,
312 : BATgroupcount, NULL, NULL, NULL, "aggr.count");
313 : }
314 :
315 : #include "algebra.h" /* for ALGprojection */
316 : static str
317 1 : AGGRmin3(bat *retval, const bat *bid, const bat *gid, const bat *eid)
318 : {
319 1 : bat tmpid;
320 1 : str err;
321 :
322 1 : err = AGGRgrouped(&tmpid, NULL, bid, gid, eid, NULL, false, 0, TYPE_oid,
323 : BATgroupmin, NULL, NULL, NULL, "aggr.min");
324 1 : if (err == MAL_SUCCEED) {
325 1 : err = ALGprojection(retval, &tmpid, bid);
326 1 : BBPrelease(tmpid);
327 : }
328 1 : return err;
329 : }
330 :
331 : static str
332 1 : AGGRmax3(bat *retval, const bat *bid, const bat *gid, const bat *eid)
333 : {
334 1 : bat tmpid;
335 1 : str err;
336 :
337 1 : err = AGGRgrouped(&tmpid, NULL, bid, gid, eid, NULL, false, 0, TYPE_oid,
338 : BATgroupmax, NULL, NULL, NULL, "aggr.max");
339 1 : if (err == MAL_SUCCEED) {
340 1 : err = ALGprojection(retval, &tmpid, bid);
341 1 : BBPrelease(tmpid);
342 : }
343 1 : return err;
344 : }
345 :
346 : static str
347 9 : AGGRsubsum_bte(bat *retval, const bat *bid, const bat *gid, const bat *eid,
348 : const bit *skip_nils)
349 : {
350 9 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
351 : 0, TYPE_bte, BATgroupsum, NULL,
352 : NULL, NULL, "aggr.subsum");
353 : }
354 :
355 : static str
356 12 : AGGRsubsum_sht(bat *retval, const bat *bid, const bat *gid, const bat *eid,
357 : const bit *skip_nils)
358 : {
359 12 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
360 : 0, TYPE_sht, BATgroupsum, NULL,
361 : NULL, NULL, "aggr.subsum");
362 : }
363 :
364 : static str
365 888 : AGGRsubsum_int(bat *retval, const bat *bid, const bat *gid, const bat *eid,
366 : const bit *skip_nils)
367 : {
368 888 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
369 : 0, TYPE_int, BATgroupsum, NULL,
370 : NULL, NULL, "aggr.subsum");
371 : }
372 :
373 : static str
374 3535 : AGGRsubsum_lng(bat *retval, const bat *bid, const bat *gid, const bat *eid,
375 : const bit *skip_nils)
376 : {
377 3535 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
378 : 0, TYPE_lng, BATgroupsum, NULL,
379 : NULL, NULL, "aggr.subsum");
380 : }
381 :
382 : #ifdef HAVE_HGE
383 : static str
384 2154 : AGGRsubsum_hge(bat *retval, const bat *bid, const bat *gid, const bat *eid,
385 : bit *skip_nils)
386 : {
387 2154 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
388 : 0, TYPE_hge, BATgroupsum, NULL,
389 : NULL, NULL, "aggr.subsum");
390 : }
391 : #endif
392 :
393 : static str
394 0 : AGGRsubsum_flt(bat *retval, const bat *bid, const bat *gid, const bat *eid,
395 : const bit *skip_nils)
396 : {
397 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
398 : 0, TYPE_flt, BATgroupsum, NULL,
399 : NULL, NULL, "aggr.subsum");
400 : }
401 :
402 : static str
403 47 : AGGRsubsum_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid,
404 : const bit *skip_nils)
405 : {
406 47 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
407 : 0, TYPE_dbl, BATgroupsum, NULL,
408 : NULL, NULL, "aggr.subsum");
409 : }
410 :
411 : static str
412 0 : AGGRsubsumcand_bte(bat *retval, const bat *bid, const bat *gid, const bat *eid,
413 : const bat *sid, const bit *skip_nils)
414 : {
415 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
416 : 0, TYPE_bte, BATgroupsum, NULL,
417 : NULL, NULL, "aggr.subsum");
418 : }
419 :
420 : static str
421 0 : AGGRsubsumcand_sht(bat *retval, const bat *bid, const bat *gid, const bat *eid,
422 : const bat *sid, const bit *skip_nils)
423 : {
424 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
425 : 0, TYPE_sht, BATgroupsum, NULL,
426 : NULL, NULL, "aggr.subsum");
427 : }
428 :
429 : static str
430 0 : AGGRsubsumcand_int(bat *retval, const bat *bid, const bat *gid, const bat *eid,
431 : const bat *sid, const bit *skip_nils)
432 : {
433 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
434 : 0, TYPE_int, BATgroupsum, NULL,
435 : NULL, NULL, "aggr.subsum");
436 : }
437 :
438 : static str
439 0 : AGGRsubsumcand_lng(bat *retval, const bat *bid, const bat *gid, const bat *eid,
440 : const bat *sid, const bit *skip_nils)
441 : {
442 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
443 : 0, TYPE_lng, BATgroupsum, NULL,
444 : NULL, NULL, "aggr.subsum");
445 : }
446 :
447 : #ifdef HAVE_HGE
448 : static str
449 0 : AGGRsubsumcand_hge(bat *retval, const bat *bid, const bat *gid, const bat *eid,
450 : const bat *sid, const bit *skip_nils)
451 : {
452 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
453 : 0, TYPE_hge, BATgroupsum, NULL,
454 : NULL, NULL, "aggr.subsum");
455 : }
456 : #endif
457 :
458 : static str
459 0 : AGGRsubsumcand_flt(bat *retval, const bat *bid, const bat *gid, const bat *eid,
460 : const bat *sid, const bit *skip_nils)
461 : {
462 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
463 : 0, TYPE_flt, BATgroupsum, NULL,
464 : NULL, NULL, "aggr.subsum");
465 : }
466 :
467 : static str
468 0 : AGGRsubsumcand_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid,
469 : const bat *sid, const bit *skip_nils)
470 : {
471 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
472 : 0, TYPE_dbl, BATgroupsum, NULL,
473 : NULL, NULL, "aggr.subsum");
474 : }
475 :
476 : static str
477 0 : AGGRsubprod_bte(bat *retval, const bat *bid, const bat *gid, const bat *eid,
478 : const bit *skip_nils)
479 : {
480 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
481 : 0, TYPE_bte, BATgroupprod, NULL,
482 : NULL, NULL, "aggr.subprod");
483 : }
484 :
485 : static str
486 0 : AGGRsubprod_sht(bat *retval, const bat *bid, const bat *gid, const bat *eid,
487 : const bit *skip_nils)
488 : {
489 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
490 : 0, TYPE_sht, BATgroupprod, NULL,
491 : NULL, NULL, "aggr.subprod");
492 : }
493 :
494 : static str
495 0 : AGGRsubprod_int(bat *retval, const bat *bid, const bat *gid, const bat *eid,
496 : const bit *skip_nils)
497 : {
498 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
499 : 0, TYPE_int, BATgroupprod, NULL,
500 : NULL, NULL, "aggr.subprod");
501 : }
502 :
503 : static str
504 0 : AGGRsubprod_lng(bat *retval, const bat *bid, const bat *gid, const bat *eid,
505 : const bit *skip_nils)
506 : {
507 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
508 : 0, TYPE_lng, BATgroupprod, NULL,
509 : NULL, NULL, "aggr.subprod");
510 : }
511 :
512 : #ifdef HAVE_HGE
513 : static str
514 0 : AGGRsubprod_hge(bat *retval, const bat *bid, const bat *gid, const bat *eid,
515 : const bit *skip_nils)
516 : {
517 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
518 : 0, TYPE_hge, BATgroupprod, NULL,
519 : NULL, NULL, "aggr.subprod");
520 : }
521 : #endif
522 :
523 : static str
524 0 : AGGRsubprod_flt(bat *retval, const bat *bid, const bat *gid, const bat *eid,
525 : const bit *skip_nils)
526 : {
527 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
528 : 0, TYPE_flt, BATgroupprod, NULL,
529 : NULL, NULL, "aggr.subprod");
530 : }
531 :
532 : static str
533 12 : AGGRsubprod_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid,
534 : const bit *skip_nils)
535 : {
536 12 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
537 : 0, TYPE_dbl, BATgroupprod, NULL,
538 : NULL, NULL, "aggr.subprod");
539 : }
540 :
541 : static str
542 0 : AGGRsubprodcand_bte(bat *retval, const bat *bid, const bat *gid, const bat *eid,
543 : const bat *sid, const bit *skip_nils)
544 : {
545 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
546 : 0, TYPE_bte, BATgroupprod, NULL,
547 : NULL, NULL, "aggr.subprod");
548 : }
549 :
550 : static str
551 0 : AGGRsubprodcand_sht(bat *retval, const bat *bid, const bat *gid, const bat *eid,
552 : const bat *sid, const bit *skip_nils)
553 : {
554 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
555 : 0, TYPE_sht, BATgroupprod, NULL,
556 : NULL, NULL, "aggr.subprod");
557 : }
558 :
559 : static str
560 0 : AGGRsubprodcand_int(bat *retval, const bat *bid, const bat *gid, const bat *eid,
561 : const bat *sid, const bit *skip_nils)
562 : {
563 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
564 : 0, TYPE_int, BATgroupprod, NULL,
565 : NULL, NULL, "aggr.subprod");
566 : }
567 :
568 : static str
569 0 : AGGRsubprodcand_lng(bat *retval, const bat *bid, const bat *gid, const bat *eid,
570 : const bat *sid, const bit *skip_nils)
571 : {
572 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
573 : 0, TYPE_lng, BATgroupprod, NULL,
574 : NULL, NULL, "aggr.subprod");
575 : }
576 :
577 : #ifdef HAVE_HGE
578 : static str
579 0 : AGGRsubprodcand_hge(bat *retval, const bat *bid, const bat *gid, const bat *eid,
580 : const bat *sid, const bit *skip_nils)
581 : {
582 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
583 : 0, TYPE_hge, BATgroupprod, NULL,
584 : NULL, NULL, "aggr.subprod");
585 : }
586 : #endif
587 :
588 : static str
589 0 : AGGRsubprodcand_flt(bat *retval, const bat *bid, const bat *gid, const bat *eid,
590 : const bat *sid, const bit *skip_nils)
591 : {
592 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
593 : 0, TYPE_flt, BATgroupprod, NULL,
594 : NULL, NULL, "aggr.subprod");
595 : }
596 :
597 : static str
598 0 : AGGRsubprodcand_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid,
599 : const bat *sid, const bit *skip_nils)
600 : {
601 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
602 : 0, TYPE_dbl, BATgroupprod, NULL,
603 : NULL, NULL, "aggr.subprod");
604 : }
605 :
606 : static str
607 130 : AGGRsubavg1_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid,
608 : const bit *skip_nils)
609 : {
610 130 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
611 : 0, TYPE_dbl, NULL, BATgroupavg,
612 : NULL, NULL, "aggr.subavg");
613 : }
614 :
615 : static str
616 0 : AGGRsubavg1cand_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid,
617 : const bat *sid, const bit *skip_nils)
618 : {
619 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
620 : 0, TYPE_dbl, NULL, BATgroupavg,
621 : NULL, NULL, "aggr.subavg");
622 : }
623 :
624 : static str
625 189 : AGGRsubavg2_dbl(bat *retval1, bat *retval2, const bat *bid, const bat *gid,
626 : const bat *eid, const bit *skip_nils)
627 : {
628 189 : return AGGRgrouped(retval1, retval2, bid, gid, eid, NULL, *skip_nils,
629 : 0, TYPE_dbl, NULL, BATgroupavg,
630 : NULL, NULL, "aggr.subavg");
631 : }
632 :
633 : static str
634 0 : AGGRsubavg2cand_dbl(bat *retval1, bat *retval2, const bat *bid, const bat *gid,
635 : const bat *eid, const bat *sid, const bit *skip_nils)
636 : {
637 0 : return AGGRgrouped(retval1, retval2, bid, gid, eid, sid, *skip_nils,
638 : 0, TYPE_dbl, NULL, BATgroupavg,
639 : NULL, NULL, "aggr.subavg");
640 : }
641 :
642 : static str
643 0 : AGGRsubavg1s_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid,
644 : const bit *skip_nils, const int *scale)
645 : {
646 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
647 : *scale, TYPE_dbl, NULL, BATgroupavg,
648 : NULL, NULL, "aggr.subavg");
649 : }
650 :
651 : static str
652 0 : AGGRsubavg1scand_dbl(bat *retval, const bat *bid, const bat *gid,
653 : const bat *eid, const bat *sid, const bit *skip_nils,
654 : const int *scale)
655 : {
656 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
657 : *scale, TYPE_dbl, NULL, BATgroupavg,
658 : NULL, NULL, "aggr.subavg");
659 : }
660 :
661 : static str
662 0 : AGGRsubavg2s_dbl(bat *retval1, bat *retval2, const bat *bid, const bat *gid,
663 : const bat *eid, const bit *skip_nils, const int *scale)
664 : {
665 0 : return AGGRgrouped(retval1, retval2, bid, gid, eid, NULL, *skip_nils,
666 : *scale, TYPE_dbl, NULL, BATgroupavg,
667 : NULL, NULL, "aggr.subavg");
668 : }
669 :
670 : static str
671 0 : AGGRsubavg2scand_dbl(bat *retval1, bat *retval2, const bat *bid, const bat *gid,
672 : const bat *eid, const bat *sid, const bit *skip_nils,
673 : const int *scale)
674 : {
675 0 : return AGGRgrouped(retval1, retval2, bid, gid, eid, sid, *skip_nils,
676 : *scale, TYPE_dbl, NULL, BATgroupavg,
677 : NULL, NULL, "aggr.subavg");
678 : }
679 :
680 : static str
681 209 : AGGRavg3(bat *retval1, bat *retval2, bat *retval3, const bat *bid,
682 : const bat *gid, const bat *eid, const bat *sid, const bit *skip_nils)
683 : {
684 209 : BAT *b, *g, *e, *s, *avgs, *cnts, *rems;
685 209 : gdk_return rc;
686 :
687 209 : b = BATdescriptor(*bid);
688 210 : g = gid != NULL && !is_bat_nil(*gid) ? BATdescriptor(*gid) : NULL;
689 213 : e = eid != NULL && !is_bat_nil(*eid) ? BATdescriptor(*eid) : NULL;
690 213 : s = sid != NULL && !is_bat_nil(*sid) ? BATdescriptor(*sid) : NULL;
691 :
692 213 : if (b == NULL ||
693 213 : (gid != NULL && !is_bat_nil(*gid) && g == NULL) ||
694 213 : (eid != NULL && !is_bat_nil(*eid) && e == NULL) ||
695 213 : (sid != NULL && !is_bat_nil(*sid) && s == NULL)) {
696 0 : BBPreclaim(b);
697 0 : BBPreclaim(g);
698 0 : BBPreclaim(e);
699 0 : BBPreclaim(s);
700 0 : throw(MAL, "aggr.subavg", SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
701 : }
702 :
703 213 : rc = BATgroupavg3(&avgs, &rems, &cnts, b, g, e, s, *skip_nils);
704 :
705 213 : BBPunfix(b->batCacheid);
706 213 : BBPreclaim(g);
707 213 : BBPreclaim(e);
708 213 : BBPreclaim(s);
709 213 : if (rc != GDK_SUCCEED)
710 0 : throw(MAL, "aggr.subavg", GDK_EXCEPTION);
711 213 : *retval1 = avgs->batCacheid;
712 213 : BBPkeepref(avgs);
713 212 : *retval2 = rems->batCacheid;
714 212 : BBPkeepref(rems);
715 213 : *retval3 = cnts->batCacheid;
716 213 : BBPkeepref(cnts);
717 213 : return MAL_SUCCEED;
718 : }
719 :
720 : static str
721 19 : AGGRavg3comb(bat *retval1, const bat *bid, const bat *rid, const bat *cid,
722 : const bat *gid, const bat *eid, const bit *skip_nils)
723 : {
724 19 : BAT *b, *r, *c, *g, *e, *bn;
725 :
726 19 : b = BATdescriptor(*bid);
727 19 : r = BATdescriptor(*rid);
728 19 : c = BATdescriptor(*cid);
729 19 : g = gid != NULL && !is_bat_nil(*gid) ? BATdescriptor(*gid) : NULL;
730 19 : e = eid != NULL && !is_bat_nil(*eid) ? BATdescriptor(*eid) : NULL;
731 :
732 19 : if (b == NULL ||
733 19 : r == NULL ||
734 19 : c == NULL ||
735 19 : (gid != NULL && !is_bat_nil(*gid) && g == NULL) ||
736 19 : (eid != NULL && !is_bat_nil(*eid) && e == NULL)) {
737 0 : BBPreclaim(b);
738 0 : BBPreclaim(r);
739 0 : BBPreclaim(c);
740 0 : BBPreclaim(g);
741 0 : BBPreclaim(e);
742 0 : throw(MAL, "aggr.subavg", SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
743 : }
744 :
745 19 : bn = BATgroupavg3combine(b, r, c, g, e, *skip_nils);
746 :
747 19 : BBPunfix(b->batCacheid);
748 19 : BBPunfix(r->batCacheid);
749 19 : BBPunfix(c->batCacheid);
750 19 : BBPreclaim(g);
751 19 : BBPreclaim(e);
752 19 : if (bn == NULL)
753 0 : throw(MAL, "aggr.subavg", GDK_EXCEPTION);
754 19 : *retval1 = bn->batCacheid;
755 19 : BBPkeepref(bn);
756 19 : return MAL_SUCCEED;
757 : }
758 :
759 : static str
760 7 : AGGRsubstdev_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid,
761 : const bit *skip_nils)
762 : {
763 7 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
764 : 0, TYPE_dbl, BATgroupstdev_sample,
765 : NULL, NULL, NULL, "aggr.substdev");
766 : }
767 :
768 : static str
769 0 : AGGRsubstdevcand_dbl(bat *retval, const bat *bid, const bat *gid,
770 : const bat *eid, const bat *sid, const bit *skip_nils)
771 : {
772 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
773 : 0, TYPE_dbl, BATgroupstdev_sample,
774 : NULL, NULL, NULL, "aggr.substdev");
775 : }
776 :
777 : static str
778 5 : AGGRsubstdevp_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid,
779 : const bit *skip_nils)
780 : {
781 5 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
782 : 0, TYPE_dbl,
783 : BATgroupstdev_population, NULL, NULL, NULL,
784 : "aggr.substdevp");
785 : }
786 :
787 : static str
788 0 : AGGRsubstdevpcand_dbl(bat *retval, const bat *bid, const bat *gid,
789 : const bat *eid, const bat *sid, const bit *skip_nils)
790 : {
791 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
792 : 0, TYPE_dbl,
793 : BATgroupstdev_population,
794 : NULL, NULL, NULL, "aggr.substdevp");
795 : }
796 :
797 : static str
798 1 : AGGRsubvariance_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid,
799 : const bit *skip_nils)
800 : {
801 1 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
802 : 0, TYPE_dbl, BATgroupvariance_sample,
803 : NULL, NULL, NULL, "aggr.subvariance");
804 : }
805 :
806 : static str
807 0 : AGGRsubvariancecand_dbl(bat *retval, const bat *bid, const bat *gid,
808 : const bat *eid, const bat *sid, const bit *skip_nils)
809 : {
810 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
811 : 0, TYPE_dbl, BATgroupvariance_sample,
812 : NULL, NULL, NULL, "aggr.subvariance");
813 : }
814 :
815 : static str
816 4 : AGGRsubvariancep_dbl(bat *retval, const bat *bid, const bat *gid,
817 : const bat *eid, const bit *skip_nils)
818 : {
819 4 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
820 : 0, TYPE_dbl,
821 : BATgroupvariance_population, NULL,
822 : NULL, NULL, "aggr.subvariancep");
823 : }
824 :
825 : static str
826 0 : AGGRsubvariancepcand_dbl(bat *retval, const bat *bid, const bat *gid,
827 : const bat *eid, const bat *sid, const bit *skip_nils)
828 : {
829 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
830 : 0, TYPE_dbl,
831 : BATgroupvariance_population, NULL,
832 : NULL, NULL, "aggr.subvariancep");
833 : }
834 :
835 : static str
836 28618 : AGGRsubcount(bat *retval, const bat *bid, const bat *gid, const bat *eid,
837 : const bit *skip_nils)
838 : {
839 28618 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
840 : 0, TYPE_lng, BATgroupcount, NULL, NULL,
841 : NULL, "aggr.subcount");
842 : }
843 :
844 : static str
845 0 : AGGRsubcountcand(bat *retval, const bat *bid, const bat *gid, const bat *eid,
846 : const bat *sid, const bit *skip_nils)
847 : {
848 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
849 : 0, TYPE_lng, BATgroupcount, NULL,
850 : NULL, NULL, "aggr.subcount");
851 : }
852 :
853 : static str
854 0 : AGGRsubmin(bat *retval, const bat *bid, const bat *gid, const bat *eid,
855 : const bit *skip_nils)
856 : {
857 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
858 : 0, TYPE_oid, BATgroupmin, NULL,
859 : NULL, NULL, "aggr.submin");
860 : }
861 :
862 : static str
863 0 : AGGRsubmincand(bat *retval, const bat *bid, const bat *gid, const bat *eid,
864 : const bat *sid, const bit *skip_nils)
865 : {
866 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
867 : 0, TYPE_oid, BATgroupmin, NULL,
868 : NULL, NULL, "aggr.submin");
869 : }
870 :
871 : static str
872 0 : AGGRsubmax(bat *retval, const bat *bid, const bat *gid, const bat *eid,
873 : const bit *skip_nils)
874 : {
875 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
876 : 0, TYPE_oid, BATgroupmax, NULL,
877 : NULL, NULL, "aggr.submax");
878 : }
879 :
880 : static str
881 0 : AGGRsubmaxcand(bat *retval, const bat *bid, const bat *gid, const bat *eid,
882 : const bat *sid, const bit *skip_nils)
883 : {
884 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
885 : 0, TYPE_oid, BATgroupmax, NULL,
886 : NULL, NULL, "aggr.submax");
887 : }
888 :
889 : static str
890 538 : AGGRsubmincand_val(bat *retval, const bat *bid, const bat *gid, const bat *eid,
891 : const bat *sid, const bit *skip_nils)
892 : {
893 538 : bat tmpid;
894 538 : str err;
895 :
896 538 : err = AGGRgrouped(&tmpid, NULL, bid, gid, eid, sid, *skip_nils,
897 : 0, TYPE_oid, BATgroupmin, NULL, NULL, NULL,
898 : "aggr.submin");
899 538 : if (err == MAL_SUCCEED) {
900 538 : err = ALGprojection(retval, &tmpid, bid);
901 537 : BBPrelease(tmpid);
902 : }
903 536 : return err;
904 : }
905 :
906 : static str
907 537 : AGGRsubmin_val(bat *retval, const bat *bid, const bat *gid, const bat *eid,
908 : const bit *skip_nils)
909 : {
910 537 : return AGGRsubmincand_val(retval, bid, gid, eid, NULL, skip_nils);
911 : }
912 :
913 : static str
914 664 : AGGRsubmaxcand_val(bat *retval, const bat *bid, const bat *gid, const bat *eid,
915 : const bat *sid, const bit *skip_nils)
916 : {
917 664 : bat tmpid;
918 664 : str err;
919 :
920 664 : err = AGGRgrouped(&tmpid, NULL, bid, gid, eid, sid, *skip_nils,
921 : 0, TYPE_oid, BATgroupmax, NULL, NULL, NULL,
922 : "aggr.submax");
923 663 : if (err == MAL_SUCCEED) {
924 663 : err = ALGprojection(retval, &tmpid, bid);
925 664 : BBPrelease(tmpid);
926 : }
927 663 : return err;
928 : }
929 :
930 : static str
931 664 : AGGRsubmax_val(bat *retval, const bat *bid, const bat *gid, const bat *eid,
932 : const bit *skip_nils)
933 : {
934 664 : return AGGRsubmaxcand_val(retval, bid, gid, eid, NULL, skip_nils);
935 : }
936 :
937 : static str
938 22 : AGGRmedian(void *retval, const bat *bid)
939 : {
940 22 : str err;
941 22 : bat rval;
942 22 : if ((err = AGGRgrouped(&rval, NULL, bid, NULL, NULL, NULL, true,
943 : 0, TYPE_any, BATgroupmedian, NULL,
944 : NULL, NULL, "aggr.submedian")) == MAL_SUCCEED) {
945 22 : oid pos = 0;
946 22 : err = ALGfetchoid(retval, &rval, &pos);
947 22 : BBPrelease(rval);
948 : }
949 22 : return err;
950 : }
951 :
952 : static str
953 7 : AGGRsubmedian(bat *retval, const bat *bid, const bat *gid, const bat *eid,
954 : const bit *skip_nils)
955 : {
956 7 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
957 : 0, TYPE_any, BATgroupmedian, NULL,
958 : NULL, NULL, "aggr.submedian");
959 : }
960 :
961 : static str
962 0 : AGGRsubmediancand(bat *retval, const bat *bid, const bat *gid, const bat *eid,
963 : const bat *sid, const bit *skip_nils)
964 : {
965 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
966 : 0, TYPE_any, BATgroupmedian, NULL,
967 : NULL, NULL, "aggr.submedian");
968 : }
969 :
970 : /* quantile functions, could make median functions obsolete completely */
971 : static str
972 8 : AGGRquantile(void *retval, const bat *bid, const bat *qid)
973 : {
974 8 : str err;
975 8 : bat rval;
976 8 : if ((err = AGGRgrouped(&rval, NULL, bid, NULL, NULL, NULL, true,
977 : 0, TYPE_any, NULL, NULL, BATgroupquantile,
978 : qid, "aggr.subquantile")) == MAL_SUCCEED) {
979 6 : oid pos = 0;
980 6 : err = ALGfetchoid(retval, &rval, &pos);
981 6 : BBPrelease(rval);
982 : }
983 8 : return err;
984 : }
985 :
986 : static str
987 16 : AGGRquantile_cst(void *retval, const bat *bid, const dbl *q)
988 : {
989 16 : str err;
990 16 : bat rval;
991 16 : if ((err = AGGRgrouped_bat_or_val(&rval, NULL, bid, NULL, NULL, NULL, true,
992 : 0, TYPE_any, NULL, NULL, BATgroupquantile,
993 : NULL, q,
994 : "aggr.subquantile")) == MAL_SUCCEED) {
995 14 : oid pos = 0;
996 14 : err = ALGfetchoid(retval, &rval, &pos);
997 14 : BBPrelease(rval);
998 : }
999 16 : return err;
1000 : }
1001 :
1002 : static str
1003 13 : AGGRsubquantile(bat *retval, const bat *bid, const bat *quantile,
1004 : const bat *gid, const bat *eid, const bit *skip_nils)
1005 : {
1006 13 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
1007 : 0, TYPE_any, NULL, NULL, BATgroupquantile,
1008 : quantile, "aggr.subquantile");
1009 : }
1010 :
1011 : static str
1012 0 : AGGRsubquantilecand(bat *retval, const bat *bid, const bat *quantile,
1013 : const bat *gid, const bat *eid, const bat *sid,
1014 : const bit *skip_nils)
1015 : {
1016 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
1017 : 0, TYPE_any, NULL, NULL, BATgroupquantile,
1018 : quantile, "aggr.subquantile");
1019 : }
1020 :
1021 : static str
1022 2 : AGGRmedian_avg(dbl *retval, const bat *bid)
1023 : {
1024 2 : str err;
1025 2 : bat rval;
1026 2 : if ((err = AGGRgrouped(&rval, NULL, bid, NULL, NULL, NULL, true,
1027 : 0, TYPE_any, BATgroupmedian_avg, NULL,
1028 : NULL, NULL, "aggr.submedian_avg")) == MAL_SUCCEED) {
1029 2 : oid pos = 0;
1030 2 : err = ALGfetchoid(retval, &rval, &pos);
1031 2 : BBPrelease(rval);
1032 : }
1033 2 : return err;
1034 : }
1035 :
1036 : static str
1037 1 : AGGRsubmedian_avg(bat *retval, const bat *bid, const bat *gid, const bat *eid,
1038 : const bit *skip_nils)
1039 : {
1040 1 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
1041 : 0, TYPE_any, BATgroupmedian_avg, NULL,
1042 : NULL, NULL, "aggr.submedian_avg");
1043 : }
1044 :
1045 : static str
1046 0 : AGGRsubmediancand_avg(bat *retval, const bat *bid, const bat *gid,
1047 : const bat *eid, const bat *sid, const bit *skip_nils)
1048 : {
1049 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
1050 : 0, TYPE_any, BATgroupmedian_avg, NULL,
1051 : NULL, NULL, "aggr.submedian_avg");
1052 : }
1053 :
1054 : /* quantile functions, could make median functions obsolete completely */
1055 : static str
1056 0 : AGGRquantile_avg(dbl *retval, const bat *bid, const bat *qid)
1057 : {
1058 0 : str err;
1059 0 : bat rval;
1060 0 : if ((err = AGGRgrouped(&rval, NULL, bid, NULL, NULL, NULL, true,
1061 : 0, TYPE_any, NULL, NULL, BATgroupquantile_avg,
1062 : qid, "aggr.subquantile_avg")) == MAL_SUCCEED) {
1063 0 : oid pos = 0;
1064 0 : err = ALGfetchoid(retval, &rval, &pos);
1065 0 : BBPrelease(rval);
1066 : }
1067 0 : return err;
1068 : }
1069 :
1070 : static str
1071 2 : AGGRquantile_avg_cst(dbl *retval, const bat *bid, const dbl *q)
1072 : {
1073 2 : str err;
1074 2 : bat rval;
1075 2 : if ((err = AGGRgrouped_bat_or_val(&rval, NULL, bid, NULL, NULL, NULL, true,
1076 : 0, TYPE_any, NULL, NULL,
1077 : BATgroupquantile_avg, NULL, q,
1078 : "aggr.subquantile_avg")) == MAL_SUCCEED) {
1079 2 : oid pos = 0;
1080 2 : err = ALGfetchoid(retval, &rval, &pos);
1081 2 : BBPrelease(rval);
1082 : }
1083 2 : return err;
1084 : }
1085 :
1086 : static str
1087 1 : AGGRsubquantile_avg(bat *retval, const bat *bid, const bat *quantile,
1088 : const bat *gid, const bat *eid, const bit *skip_nils)
1089 : {
1090 1 : return AGGRgrouped(retval, NULL, bid, gid, eid, NULL, *skip_nils,
1091 : 0, TYPE_any, NULL, NULL, BATgroupquantile_avg,
1092 : quantile, "aggr.subquantile_avg");
1093 : }
1094 :
1095 : static str
1096 0 : AGGRsubquantilecand_avg(bat *retval, const bat *bid, const bat *quantile,
1097 : const bat *gid, const bat *eid, const bat *sid,
1098 : const bit *skip_nils)
1099 : {
1100 0 : return AGGRgrouped(retval, NULL, bid, gid, eid, sid, *skip_nils,
1101 : 0, TYPE_any, NULL, NULL, BATgroupquantile_avg,
1102 : quantile, "aggr.subquantile_avg");
1103 : }
1104 :
1105 : static str
1106 54 : AGGRgroup_str_concat(bat *retval1, const bat *bid, const bat *gid,
1107 : const bat *eid, const bat *sid, bool skip_nils,
1108 : const bat *sepid, const char *separator,
1109 : const char *malfunc)
1110 : {
1111 54 : BAT *b, *g, *e, *s, *sep, *bn = NULL;
1112 :
1113 54 : b = BATdescriptor(*bid);
1114 54 : g = gid ? BATdescriptor(*gid) : NULL;
1115 54 : e = eid ? BATdescriptor(*eid) : NULL;
1116 54 : s = sid ? BATdescriptor(*sid) : NULL;
1117 54 : sep = sepid ? BATdescriptor(*sepid) : NULL;
1118 :
1119 54 : if (b == NULL || (gid != NULL && g == NULL) || (eid != NULL && e == NULL) ||
1120 54 : (sid != NULL && s == NULL) || (sepid != NULL && sep == NULL)) {
1121 0 : BBPreclaim(b);
1122 0 : BBPreclaim(g);
1123 0 : BBPreclaim(e);
1124 0 : BBPreclaim(s);
1125 0 : BBPreclaim(sep);
1126 0 : throw(MAL, malfunc, SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
1127 : }
1128 :
1129 54 : bn = BATgroupstr_group_concat(b, g, e, s, sep, skip_nils, separator);
1130 :
1131 54 : BBPunfix(b->batCacheid);
1132 54 : BBPreclaim(g);
1133 54 : BBPreclaim(e);
1134 54 : BBPreclaim(s);
1135 54 : BBPreclaim(sep);
1136 54 : if (bn == NULL)
1137 0 : throw(MAL, malfunc, GDK_EXCEPTION);
1138 54 : *retval1 = bn->batCacheid;
1139 54 : BBPkeepref(bn);
1140 54 : return MAL_SUCCEED;
1141 : }
1142 :
1143 : #define DEFAULT_SEPARATOR ","
1144 :
1145 : static str
1146 0 : AGGRstr_group_concat(bat *retval, const bat *bid, const bat *gid,
1147 : const bat *eid)
1148 : {
1149 0 : return AGGRgroup_str_concat(retval, bid, gid, eid, NULL, true, NULL,
1150 : DEFAULT_SEPARATOR, "aggr.str_group_concat");
1151 : }
1152 :
1153 : static str
1154 20 : AGGRsubstr_group_concat(bat *retval, const bat *bid, const bat *gid,
1155 : const bat *eid, const bit *skip_nils)
1156 : {
1157 20 : return AGGRgroup_str_concat(retval, bid, gid, eid, NULL, *skip_nils, NULL,
1158 : DEFAULT_SEPARATOR, "aggr.substr_group_concat");
1159 : }
1160 :
1161 : static str
1162 0 : AGGRsubstr_group_concatcand(bat *retval, const bat *bid, const bat *gid,
1163 : const bat *eid, const bat *sid,
1164 : const bit *skip_nils)
1165 : {
1166 0 : return AGGRgroup_str_concat(retval, bid, gid, eid, sid, *skip_nils, NULL,
1167 : DEFAULT_SEPARATOR, "aggr.substr_group_concat");
1168 : }
1169 :
1170 : static str
1171 0 : AGGRstr_group_concat_sep(bat *retval, const bat *bid, const bat *sep,
1172 : const bat *gid, const bat *eid)
1173 : {
1174 0 : return AGGRgroup_str_concat(retval, bid, gid, eid, NULL, true, sep, NULL,
1175 0 : "aggr.str_group_concat_sep");;
1176 : }
1177 :
1178 : static str
1179 34 : AGGRsubstr_group_concat_sep(bat *retval, const bat *bid, const bat *sep,
1180 : const bat *gid, const bat *eid,
1181 : const bit *skip_nils)
1182 : {
1183 34 : return AGGRgroup_str_concat(retval, bid, gid, eid, NULL, *skip_nils, sep,
1184 : NULL, "aggr.substr_group_concat_sep");
1185 : }
1186 :
1187 : static str
1188 0 : AGGRsubstr_group_concatcand_sep(bat *retval, const bat *bid, const bat *sep,
1189 : const bat *gid, const bat *eid, const bat *sid,
1190 : const bit *skip_nils)
1191 : {
1192 0 : return AGGRgroup_str_concat(retval, bid, gid, eid, sid, *skip_nils, sep,
1193 : NULL, "aggr.substr_group_concat_sep");
1194 : }
1195 :
1196 : static str
1197 96 : AGGRgrouped2(bat *retval, const bat *bid1, const bat *bid2, const bat *gid,
1198 : const bat *eid, const bat *sid, bool skip_nils, int tp,
1199 : BAT *(*func)(BAT *, BAT *, BAT *, BAT *, BAT *, int tp,
1200 : bool skip_nils), const char *malfunc)
1201 : {
1202 96 : BAT *b1, *b2, *g, *e, *s, *bn = NULL;
1203 :
1204 96 : assert(func != NULL);
1205 :
1206 96 : b1 = BATdescriptor(*bid1);
1207 108 : b2 = BATdescriptor(*bid2);
1208 109 : g = gid ? BATdescriptor(*gid) : NULL;
1209 109 : e = eid ? BATdescriptor(*eid) : NULL;
1210 109 : s = sid ? BATdescriptor(*sid) : NULL;
1211 :
1212 109 : if (b1 == NULL || b2 == NULL || (gid != NULL && g == NULL)
1213 109 : || (eid != NULL && e == NULL) || (sid != NULL && s == NULL)) {
1214 0 : BBPreclaim(b1);
1215 0 : BBPreclaim(b2);
1216 0 : BBPreclaim(g);
1217 0 : BBPreclaim(e);
1218 0 : BBPreclaim(s);
1219 0 : throw(MAL, malfunc, SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
1220 : }
1221 :
1222 109 : if (b1->ttype != b2->ttype) {
1223 0 : BBPunfix(b1->batCacheid);
1224 0 : BBPunfix(b2->batCacheid);
1225 0 : BBPreclaim(g);
1226 0 : BBPreclaim(e);
1227 0 : BBPreclaim(s);
1228 0 : throw(MAL, malfunc,
1229 : SQLSTATE(42000) "%s requires both arguments of the same type",
1230 : malfunc);
1231 : }
1232 :
1233 109 : bn = (*func) (b1, b2, g, e, s, tp, skip_nils);
1234 :
1235 101 : BBPunfix(b1->batCacheid);
1236 103 : BBPunfix(b2->batCacheid);
1237 108 : BBPreclaim(g);
1238 109 : BBPreclaim(e);
1239 109 : BBPreclaim(s);
1240 109 : if (bn == NULL)
1241 1 : throw(MAL, malfunc, GDK_EXCEPTION);
1242 108 : *retval = bn->batCacheid;
1243 108 : BBPkeepref(bn);
1244 108 : return MAL_SUCCEED;
1245 : }
1246 :
1247 : static str
1248 0 : AGGRcovariance(bat *retval, const bat *b1, const bat *b2, const bat *gid,
1249 : const bat *eid)
1250 : {
1251 0 : return AGGRgrouped2(retval, b1, b2, gid, eid, NULL, true, TYPE_dbl,
1252 : BATgroupcovariance_sample, "aggr.covariance");
1253 : }
1254 :
1255 : static str
1256 28 : AGGRsubcovariance(bat *retval, const bat *b1, const bat *b2, const bat *gid,
1257 : const bat *eid, const bit *skip_nils)
1258 : {
1259 28 : return AGGRgrouped2(retval, b1, b2, gid, eid, NULL, *skip_nils, TYPE_dbl,
1260 : BATgroupcovariance_sample, "aggr.subcovariance");
1261 : }
1262 :
1263 : static str
1264 0 : AGGRsubcovariancecand(bat *retval, const bat *b1, const bat *b2, const bat *gid,
1265 : const bat *eid, const bat *sid, const bit *skip_nils)
1266 : {
1267 0 : return AGGRgrouped2(retval, b1, b2, gid, eid, sid, *skip_nils, TYPE_dbl,
1268 : BATgroupcovariance_sample, "aggr.subcovariance");
1269 : }
1270 :
1271 : static str
1272 0 : AGGRcovariancep(bat *retval, const bat *b1, const bat *b2, const bat *gid,
1273 : const bat *eid)
1274 : {
1275 0 : return AGGRgrouped2(retval, b1, b2, gid, eid, NULL, true, TYPE_dbl,
1276 : BATgroupcovariance_population, "aggr.covariancep");
1277 : }
1278 :
1279 : static str
1280 27 : AGGRsubcovariancep(bat *retval, const bat *b1, const bat *b2, const bat *gid,
1281 : const bat *eid, const bit *skip_nils)
1282 : {
1283 27 : return AGGRgrouped2(retval, b1, b2, gid, eid, NULL, *skip_nils, TYPE_dbl,
1284 : BATgroupcovariance_population, "aggr.subcovariancep");
1285 : }
1286 :
1287 : static str
1288 0 : AGGRsubcovariancepcand(bat *retval, const bat *b1, const bat *b2,
1289 : const bat *gid, const bat *eid, const bat *sid,
1290 : const bit *skip_nils)
1291 : {
1292 0 : return AGGRgrouped2(retval, b1, b2, gid, eid, sid, *skip_nils, TYPE_dbl,
1293 : BATgroupcovariance_population, "aggr.subcovariancep");
1294 : }
1295 :
1296 : static str
1297 0 : AGGRcorr(bat *retval, const bat *b1, const bat *b2, const bat *gid,
1298 : const bat *eid)
1299 : {
1300 0 : return AGGRgrouped2(retval, b1, b2, gid, eid, NULL, true, TYPE_dbl,
1301 : BATgroupcorrelation, "aggr.corr");
1302 : }
1303 :
1304 : static str
1305 45 : AGGRsubcorr(bat *retval, const bat *b1, const bat *b2, const bat *gid,
1306 : const bat *eid, const bit *skip_nils)
1307 : {
1308 45 : return AGGRgrouped2(retval, b1, b2, gid, eid, NULL, *skip_nils, TYPE_dbl,
1309 : BATgroupcorrelation, "aggr.subcorr");
1310 : }
1311 :
1312 : static str
1313 0 : AGGRsubcorrcand(bat *retval, const bat *b1, const bat *b2, const bat *gid,
1314 : const bat *eid, const bat *sid, const bit *skip_nils)
1315 : {
1316 0 : return AGGRgrouped2(retval, b1, b2, gid, eid, sid, *skip_nils, TYPE_dbl,
1317 : BATgroupcorrelation, "aggr.subcorr");
1318 : }
1319 :
1320 : #include "mel.h"
1321 : mel_func aggr_init_funcs[] = {
1322 : command("aggr", "sum", AGGRsum3_dbl, false, "Grouped tail sum on bte", args(1,4, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1323 : command("aggr", "sum", AGGRsum3_bte, false, "Grouped tail sum on bte", args(1,4, batarg("",bte),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1324 : command("aggr", "subsum", AGGRsubsum_bte, false, "Grouped sum aggregate", args(1,5, batarg("",bte),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1325 : command("aggr", "subsum", AGGRsubsumcand_bte, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",bte),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1326 : command("aggr", "prod", AGGRprod3_bte, false, "Grouped tail product on bte", args(1,4, batarg("",bte),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1327 : command("aggr", "subprod", AGGRsubprod_bte, false, "Grouped product aggregate", args(1,5, batarg("",bte),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1328 : command("aggr", "subprod", AGGRsubprodcand_bte, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",bte),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1329 : command("aggr", "sum", AGGRsum3_sht, false, "Grouped tail sum on bte", args(1,4, batarg("",sht),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1330 : command("aggr", "subsum", AGGRsubsum_sht, false, "Grouped sum aggregate", args(1,5, batarg("",sht),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1331 : command("aggr", "subsum", AGGRsubsumcand_sht, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",sht),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1332 : command("aggr", "prod", AGGRprod3_sht, false, "Grouped tail product on bte", args(1,4, batarg("",sht),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1333 : command("aggr", "subprod", AGGRsubprod_sht, false, "Grouped product aggregate", args(1,5, batarg("",sht),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1334 : command("aggr", "subprod", AGGRsubprodcand_sht, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",sht),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1335 : command("aggr", "sum", AGGRsum3_int, false, "Grouped tail sum on bte", args(1,4, batarg("",int),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1336 : command("aggr", "subsum", AGGRsubsum_int, false, "Grouped sum aggregate", args(1,5, batarg("",int),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1337 : command("aggr", "subsum", AGGRsubsumcand_int, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",int),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1338 : command("aggr", "prod", AGGRprod3_int, false, "Grouped tail product on bte", args(1,4, batarg("",int),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1339 : command("aggr", "subprod", AGGRsubprod_int, false, "Grouped product aggregate", args(1,5, batarg("",int),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1340 : command("aggr", "subprod", AGGRsubprodcand_int, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",int),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1341 : command("aggr", "sum", AGGRsum3_lng, false, "Grouped tail sum on bte", args(1,4, batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1342 : command("aggr", "subsum", AGGRsubsum_lng, false, "Grouped sum aggregate", args(1,5, batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1343 : command("aggr", "subsum", AGGRsubsumcand_lng, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1344 : command("aggr", "prod", AGGRprod3_lng, false, "Grouped tail product on bte", args(1,4, batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1345 : command("aggr", "subprod", AGGRsubprod_lng, false, "Grouped product aggregate", args(1,5, batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1346 : command("aggr", "subprod", AGGRsubprodcand_lng, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1347 : command("aggr", "sum", AGGRsum3_dbl, false, "Grouped tail sum on sht", args(1,4, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1348 : command("aggr", "sum", AGGRsum3_sht, false, "Grouped tail sum on sht", args(1,4, batarg("",sht),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1349 : command("aggr", "subsum", AGGRsubsum_sht, false, "Grouped sum aggregate", args(1,5, batarg("",sht),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1350 : command("aggr", "subsum", AGGRsubsumcand_sht, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",sht),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1351 : command("aggr", "prod", AGGRprod3_sht, false, "Grouped tail product on sht", args(1,4, batarg("",sht),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1352 : command("aggr", "subprod", AGGRsubprod_sht, false, "Grouped product aggregate", args(1,5, batarg("",sht),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1353 : command("aggr", "subprod", AGGRsubprodcand_sht, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",sht),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1354 : command("aggr", "sum", AGGRsum3_int, false, "Grouped tail sum on sht", args(1,4, batarg("",int),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1355 : command("aggr", "subsum", AGGRsubsum_int, false, "Grouped sum aggregate", args(1,5, batarg("",int),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1356 : command("aggr", "subsum", AGGRsubsumcand_int, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",int),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1357 : command("aggr", "prod", AGGRprod3_int, false, "Grouped tail product on sht", args(1,4, batarg("",int),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1358 : command("aggr", "subprod", AGGRsubprod_int, false, "Grouped product aggregate", args(1,5, batarg("",int),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1359 : command("aggr", "subprod", AGGRsubprodcand_int, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",int),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1360 : command("aggr", "sum", AGGRsum3_lng, false, "Grouped tail sum on sht", args(1,4, batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1361 : command("aggr", "subsum", AGGRsubsum_lng, false, "Grouped sum aggregate", args(1,5, batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1362 : command("aggr", "subsum", AGGRsubsumcand_lng, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1363 : command("aggr", "prod", AGGRprod3_lng, false, "Grouped tail product on sht", args(1,4, batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1364 : command("aggr", "subprod", AGGRsubprod_lng, false, "Grouped product aggregate", args(1,5, batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1365 : command("aggr", "subprod", AGGRsubprodcand_lng, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1366 : command("aggr", "sum", AGGRsum3_dbl, false, "Grouped tail sum on int", args(1,4, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1))),
1367 : command("aggr", "sum", AGGRsum3_int, false, "Grouped tail sum on int", args(1,4, batarg("",int),batarg("b",int),batarg("g",oid),batargany("e",1))),
1368 : command("aggr", "subsum", AGGRsubsum_int, false, "Grouped sum aggregate", args(1,5, batarg("",int),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1369 : command("aggr", "subsum", AGGRsubsumcand_int, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",int),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1370 : command("aggr", "prod", AGGRprod3_int, false, "Grouped tail product on int", args(1,4, batarg("",int),batarg("b",int),batarg("g",oid),batargany("e",1))),
1371 : command("aggr", "subprod", AGGRsubprod_int, false, "Grouped product aggregate", args(1,5, batarg("",int),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1372 : command("aggr", "subprod", AGGRsubprodcand_int, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",int),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1373 : command("aggr", "sum", AGGRsum3_lng, false, "Grouped tail sum on int", args(1,4, batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1))),
1374 : command("aggr", "subsum", AGGRsubsum_lng, false, "Grouped sum aggregate", args(1,5, batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1375 : command("aggr", "subsum", AGGRsubsumcand_lng, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1376 : command("aggr", "prod", AGGRprod3_lng, false, "Grouped tail product on int", args(1,4, batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1))),
1377 : command("aggr", "subprod", AGGRsubprod_lng, false, "Grouped product aggregate", args(1,5, batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1378 : command("aggr", "subprod", AGGRsubprodcand_lng, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1379 : command("aggr", "sum", AGGRsum3_dbl, false, "Grouped tail sum on lng", args(1,4, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1))),
1380 : command("aggr", "sum", AGGRsum3_lng, false, "Grouped tail sum on lng", args(1,4, batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1))),
1381 : command("aggr", "subsum", AGGRsubsum_lng, false, "Grouped sum aggregate", args(1,5, batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1382 : command("aggr", "subsum", AGGRsubsumcand_lng, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1383 : command("aggr", "prod", AGGRprod3_lng, false, "Grouped tail product on lng", args(1,4, batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1))),
1384 : command("aggr", "subprod", AGGRsubprod_lng, false, "Grouped product aggregate", args(1,5, batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1385 : command("aggr", "subprod", AGGRsubprodcand_lng, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1386 : command("aggr", "sum", AGGRsum3_flt, false, "Grouped tail sum on flt", args(1,4, batarg("",flt),batarg("b",flt),batarg("g",oid),batargany("e",1))),
1387 : command("aggr", "subsum", AGGRsubsum_flt, false, "Grouped sum aggregate", args(1,5, batarg("",flt),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1388 : command("aggr", "subsum", AGGRsubsumcand_flt, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",flt),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1389 : command("aggr", "prod", AGGRprod3_flt, false, "Grouped tail product on flt", args(1,4, batarg("",flt),batarg("b",flt),batarg("g",oid),batargany("e",1))),
1390 : command("aggr", "subprod", AGGRsubprod_flt, false, "Grouped product aggregate", args(1,5, batarg("",flt),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1391 : command("aggr", "subprod", AGGRsubprodcand_flt, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",flt),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1392 : command("aggr", "sum", AGGRsum3_dbl, false, "Grouped tail sum on flt", args(1,4, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1))),
1393 : command("aggr", "subsum", AGGRsubsum_dbl, false, "Grouped sum aggregate", args(1,5, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1394 : command("aggr", "subsum", AGGRsubsumcand_dbl, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1395 : command("aggr", "prod", AGGRprod3_dbl, false, "Grouped tail product on flt", args(1,4, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1))),
1396 : command("aggr", "subprod", AGGRsubprod_dbl, false, "Grouped product aggregate", args(1,5, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1397 : command("aggr", "subprod", AGGRsubprodcand_dbl, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1398 : command("aggr", "sum", AGGRsum3_dbl, false, "Grouped tail sum on dbl", args(1,4, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1))),
1399 : command("aggr", "subsum", AGGRsubsum_dbl, false, "Grouped sum aggregate", args(1,5, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1400 : command("aggr", "subsum", AGGRsubsumcand_dbl, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1401 : command("aggr", "prod", AGGRprod3_dbl, false, "Grouped tail product on dbl", args(1,4, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1))),
1402 : command("aggr", "subprod", AGGRsubprod_dbl, false, "Grouped product aggregate", args(1,5, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1403 : command("aggr", "subprod", AGGRsubprodcand_dbl, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1404 : command("aggr", "avg", AGGRavg13_dbl, false, "Grouped tail average on bte", args(1,4, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1405 : command("aggr", "avg", AGGRavg23_dbl, false, "Grouped tail average on bte, also returns count", args(2,5, batarg("",dbl),batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1406 : command("aggr", "avg", AGGRavg14_dbl, false, "Grouped tail average on bte", args(1,5, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("scale",int))),
1407 : command("aggr", "avg", AGGRavg24_dbl, false, "Grouped tail average on bte, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("scale",int))),
1408 : command("aggr", "subavg", AGGRsubavg1_dbl, false, "Grouped average aggregate", args(1,5, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1409 : command("aggr", "subavg", AGGRsubavg1cand_dbl, false, "Grouped average aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1410 : command("aggr", "subavg", AGGRsubavg2_dbl, false, "Grouped average aggregate, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1411 : command("aggr", "subavg", AGGRsubavg2cand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1412 : command("aggr", "subavg", AGGRsubavg1s_dbl, false, "Grouped average aggregate", args(1,6, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1413 : command("aggr", "subavg", AGGRsubavg1scand_dbl, false, "Grouped average aggregate with candidates list", args(1,7, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1414 : command("aggr", "subavg", AGGRsubavg2s_dbl, false, "Grouped average aggregate, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1415 : command("aggr", "subavg", AGGRsubavg2scand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,8, batarg("",dbl),batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1416 : command("aggr", "stdev", AGGRstdev3_dbl, false, "Grouped tail standard deviation (sample/non-biased) on bte", args(1,4, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1417 : command("aggr", "substdev", AGGRsubstdev_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1418 : command("aggr", "substdev", AGGRsubstdevcand_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1419 : command("aggr", "stdevp", AGGRstdevp3_dbl, false, "Grouped tail standard deviation (population/biased) on bte", args(1,4, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1420 : command("aggr", "substdevp", AGGRsubstdevp_dbl, false, "Grouped standard deviation (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1421 : command("aggr", "substdevp", AGGRsubstdevpcand_dbl, false, "Grouped standard deviation (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1422 : command("aggr", "variance", AGGRvariance3_dbl, false, "Grouped tail variance (sample/non-biased) on bte", args(1,4, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1423 : command("aggr", "subvariance", AGGRsubvariance_dbl, false, "Grouped variance (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1424 : command("aggr", "subvariance", AGGRsubvariancecand_dbl, false, "Grouped variance (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1425 : command("aggr", "variancep", AGGRvariancep3_dbl, false, "Grouped tail variance (population/biased) on bte", args(1,4, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1426 : command("aggr", "subvariancep", AGGRsubvariancep_dbl, false, "Grouped variance (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1427 : command("aggr", "subvariancep", AGGRsubvariancepcand_dbl, false, "Grouped variance (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1428 : command("aggr", "covariance", AGGRcovariance, false, "Covariance sample aggregate", args(1,5, batarg("",dbl),batarg("b1",bte),batarg("b2",bte),batarg("g",oid),batargany("e",1))),
1429 : command("aggr", "subcovariance", AGGRsubcovariance, false, "Grouped covariance sample aggregate", args(1,6, batarg("",dbl),batarg("b1",bte),batarg("b2",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1430 : command("aggr", "subcovariance", AGGRsubcovariancecand, false, "Grouped covariance sample aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",bte),batarg("b2",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1431 : command("aggr", "covariancep", AGGRcovariancep, false, "Covariance population aggregate", args(1,5, batarg("",dbl),batarg("b1",bte),batarg("b2",bte),batarg("g",oid),batargany("e",1))),
1432 : command("aggr", "subcovariancep", AGGRsubcovariancep, false, "Grouped covariance population aggregate", args(1,6, batarg("",dbl),batarg("b1",bte),batarg("b2",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1433 : command("aggr", "subcovariancep", AGGRsubcovariancepcand, false, "Grouped covariance population aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",bte),batarg("b2",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1434 : command("aggr", "corr", AGGRcorr, false, "Correlation aggregate", args(1,5, batarg("",dbl),batarg("b1",bte),batarg("b2",bte),batarg("g",oid),batargany("e",1))),
1435 : command("aggr", "subcorr", AGGRsubcorr, false, "Grouped correlation aggregate", args(1,6, batarg("",dbl),batarg("b1",bte),batarg("b2",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1436 : command("aggr", "subcorr", AGGRsubcorrcand, false, "Grouped correlation aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",bte),batarg("b2",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1437 : command("aggr", "avg", AGGRavg13_dbl, false, "Grouped tail average on sht", args(1,4, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1438 : command("aggr", "avg", AGGRavg23_dbl, false, "Grouped tail average on sht, also returns count", args(2,5, batarg("",dbl),batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1439 : command("aggr", "avg", AGGRavg14_dbl, false, "Grouped tail average on sht", args(1,5, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("scale",int))),
1440 : command("aggr", "avg", AGGRavg24_dbl, false, "Grouped tail average on sht, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("scale",int))),
1441 : command("aggr", "subavg", AGGRsubavg1_dbl, false, "Grouped average aggregate", args(1,5, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1442 : command("aggr", "subavg", AGGRsubavg1cand_dbl, false, "Grouped average aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1443 : command("aggr", "subavg", AGGRsubavg2_dbl, false, "Grouped average aggregate, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1444 : command("aggr", "subavg", AGGRsubavg2cand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1445 : command("aggr", "subavg", AGGRsubavg1s_dbl, false, "Grouped average aggregate", args(1,6, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1446 : command("aggr", "subavg", AGGRsubavg1scand_dbl, false, "Grouped average aggregate with candidates list", args(1,7, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1447 : command("aggr", "subavg", AGGRsubavg2s_dbl, false, "Grouped average aggregate, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1448 : command("aggr", "subavg", AGGRsubavg2scand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,8, batarg("",dbl),batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1449 : command("aggr", "stdev", AGGRstdev3_dbl, false, "Grouped tail standard deviation (sample/non-biased) on sht", args(1,4, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1450 : command("aggr", "substdev", AGGRsubstdev_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1451 : command("aggr", "substdev", AGGRsubstdevcand_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1452 : command("aggr", "stdevp", AGGRstdevp3_dbl, false, "Grouped tail standard deviation (population/biased) on sht", args(1,4, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1453 : command("aggr", "substdevp", AGGRsubstdevp_dbl, false, "Grouped standard deviation (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1454 : command("aggr", "substdevp", AGGRsubstdevpcand_dbl, false, "Grouped standard deviation (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1455 : command("aggr", "variance", AGGRvariance3_dbl, false, "Grouped tail variance (sample/non-biased) on sht", args(1,4, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1456 : command("aggr", "subvariance", AGGRsubvariance_dbl, false, "Grouped variance (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1457 : command("aggr", "subvariance", AGGRsubvariancecand_dbl, false, "Grouped variance (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1458 : command("aggr", "variancep", AGGRvariancep3_dbl, false, "Grouped tail variance (population/biased) on sht", args(1,4, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1459 : command("aggr", "subvariancep", AGGRsubvariancep_dbl, false, "Grouped variance (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1460 : command("aggr", "subvariancep", AGGRsubvariancepcand_dbl, false, "Grouped variance (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1461 : command("aggr", "covariance", AGGRcovariance, false, "Covariance sample aggregate", args(1,5, batarg("",dbl),batarg("b1",sht),batarg("b2",sht),batarg("g",oid),batargany("e",1))),
1462 : command("aggr", "subcovariance", AGGRsubcovariance, false, "Grouped covariance sample aggregate", args(1,6, batarg("",dbl),batarg("b1",sht),batarg("b2",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1463 : command("aggr", "subcovariance", AGGRsubcovariancecand, false, "Grouped covariance sample aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",sht),batarg("b2",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1464 : command("aggr", "covariancep", AGGRcovariancep, false, "Covariance population aggregate", args(1,5, batarg("",dbl),batarg("b1",sht),batarg("b2",sht),batarg("g",oid),batargany("e",1))),
1465 : command("aggr", "subcovariancep", AGGRsubcovariancep, false, "Grouped covariance population aggregate", args(1,6, batarg("",dbl),batarg("b1",sht),batarg("b2",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1466 : command("aggr", "subcovariancep", AGGRsubcovariancepcand, false, "Grouped covariance population aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",sht),batarg("b2",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1467 : command("aggr", "corr", AGGRcorr, false, "Correlation aggregate", args(1,5, batarg("",dbl),batarg("b1",sht),batarg("b2",sht),batarg("g",oid),batargany("e",1))),
1468 : command("aggr", "subcorr", AGGRsubcorr, false, "Grouped correlation aggregate", args(1,6, batarg("",dbl),batarg("b1",sht),batarg("b2",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1469 : command("aggr", "subcorr", AGGRsubcorrcand, false, "Grouped correlation aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",sht),batarg("b2",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1470 : command("aggr", "avg", AGGRavg13_dbl, false, "Grouped tail average on int", args(1,4, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1))),
1471 : command("aggr", "avg", AGGRavg23_dbl, false, "Grouped tail average on int, also returns count", args(2,5, batarg("",dbl),batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1))),
1472 : command("aggr", "avg", AGGRavg14_dbl, false, "Grouped tail average on int", args(1,5, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),arg("scale",int))),
1473 : command("aggr", "avg", AGGRavg24_dbl, false, "Grouped tail average on int, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1),arg("scale",int))),
1474 : command("aggr", "subavg", AGGRsubavg1_dbl, false, "Grouped average aggregate", args(1,5, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1475 : command("aggr", "subavg", AGGRsubavg1cand_dbl, false, "Grouped average aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1476 : command("aggr", "subavg", AGGRsubavg2_dbl, false, "Grouped average aggregate, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1477 : command("aggr", "subavg", AGGRsubavg2cand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1478 : command("aggr", "subavg", AGGRsubavg1s_dbl, false, "Grouped average aggregate", args(1,6, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1479 : command("aggr", "subavg", AGGRsubavg1scand_dbl, false, "Grouped average aggregate with candidates list", args(1,7, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1480 : command("aggr", "subavg", AGGRsubavg2s_dbl, false, "Grouped average aggregate, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1481 : command("aggr", "subavg", AGGRsubavg2scand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,8, batarg("",dbl),batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1482 : command("aggr", "stdev", AGGRstdev3_dbl, false, "Grouped tail standard deviation (sample/non-biased) on int", args(1,4, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1))),
1483 : command("aggr", "substdev", AGGRsubstdev_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1484 : command("aggr", "substdev", AGGRsubstdevcand_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1485 : command("aggr", "stdevp", AGGRstdevp3_dbl, false, "Grouped tail standard deviation (population/biased) on int", args(1,4, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1))),
1486 : command("aggr", "substdevp", AGGRsubstdevp_dbl, false, "Grouped standard deviation (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1487 : command("aggr", "substdevp", AGGRsubstdevpcand_dbl, false, "Grouped standard deviation (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1488 : command("aggr", "variance", AGGRvariance3_dbl, false, "Grouped tail variance (sample/non-biased) on int", args(1,4, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1))),
1489 : command("aggr", "subvariance", AGGRsubvariance_dbl, false, "Grouped variance (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1490 : command("aggr", "subvariance", AGGRsubvariancecand_dbl, false, "Grouped variance (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1491 : command("aggr", "variancep", AGGRvariancep3_dbl, false, "Grouped tail variance (population/biased) on int", args(1,4, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1))),
1492 : command("aggr", "subvariancep", AGGRsubvariancep_dbl, false, "Grouped variance (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1493 : command("aggr", "subvariancep", AGGRsubvariancepcand_dbl, false, "Grouped variance (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1494 : command("aggr", "covariance", AGGRcovariance, false, "Covariance sample aggregate", args(1,5, batarg("",dbl),batarg("b1",int),batarg("b2",int),batarg("g",oid),batargany("e",1))),
1495 : command("aggr", "subcovariance", AGGRsubcovariance, false, "Grouped covariance sample aggregate", args(1,6, batarg("",dbl),batarg("b1",int),batarg("b2",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1496 : command("aggr", "subcovariance", AGGRsubcovariancecand, false, "Grouped covariance sample aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",int),batarg("b2",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1497 : command("aggr", "covariancep", AGGRcovariancep, false, "Covariance population aggregate", args(1,5, batarg("",dbl),batarg("b1",int),batarg("b2",int),batarg("g",oid),batargany("e",1))),
1498 : command("aggr", "subcovariancep", AGGRsubcovariancep, false, "Grouped covariance population aggregate", args(1,6, batarg("",dbl),batarg("b1",int),batarg("b2",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1499 : command("aggr", "subcovariancep", AGGRsubcovariancepcand, false, "Grouped covariance population aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",int),batarg("b2",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1500 : command("aggr", "corr", AGGRcorr, false, "Correlation aggregate", args(1,5, batarg("",dbl),batarg("b1",int),batarg("b2",int),batarg("g",oid),batargany("e",1))),
1501 : command("aggr", "subcorr", AGGRsubcorr, false, "Grouped correlation aggregate", args(1,6, batarg("",dbl),batarg("b1",int),batarg("b2",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1502 : command("aggr", "subcorr", AGGRsubcorrcand, false, "Grouped correlation aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",int),batarg("b2",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1503 : command("aggr", "avg", AGGRavg13_dbl, false, "Grouped tail average on lng", args(1,4, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1))),
1504 : command("aggr", "avg", AGGRavg23_dbl, false, "Grouped tail average on lng, also returns count", args(2,5, batarg("",dbl),batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1))),
1505 : command("aggr", "avg", AGGRavg14_dbl, false, "Grouped tail average on lng", args(1,5, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("scale",int))),
1506 : command("aggr", "avg", AGGRavg24_dbl, false, "Grouped tail average on lng, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("scale",int))),
1507 : command("aggr", "subavg", AGGRsubavg1_dbl, false, "Grouped average aggregate", args(1,5, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1508 : command("aggr", "subavg", AGGRsubavg1cand_dbl, false, "Grouped average aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1509 : command("aggr", "subavg", AGGRsubavg2_dbl, false, "Grouped average aggregate, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1510 : command("aggr", "subavg", AGGRsubavg2cand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1511 : command("aggr", "subavg", AGGRsubavg1s_dbl, false, "Grouped average aggregate", args(1,6, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1512 : command("aggr", "subavg", AGGRsubavg1scand_dbl, false, "Grouped average aggregate with candidates list", args(1,7, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1513 : command("aggr", "subavg", AGGRsubavg2s_dbl, false, "Grouped average aggregate, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1514 : command("aggr", "subavg", AGGRsubavg2scand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,8, batarg("",dbl),batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1515 : command("aggr", "stdev", AGGRstdev3_dbl, false, "Grouped tail standard deviation (sample/non-biased) on lng", args(1,4, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1))),
1516 : command("aggr", "substdev", AGGRsubstdev_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1517 : command("aggr", "substdev", AGGRsubstdevcand_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1518 : command("aggr", "stdevp", AGGRstdevp3_dbl, false, "Grouped tail standard deviation (population/biased) on lng", args(1,4, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1))),
1519 : command("aggr", "substdevp", AGGRsubstdevp_dbl, false, "Grouped standard deviation (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1520 : command("aggr", "substdevp", AGGRsubstdevpcand_dbl, false, "Grouped standard deviation (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1521 : command("aggr", "variance", AGGRvariance3_dbl, false, "Grouped tail variance (sample/non-biased) on lng", args(1,4, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1))),
1522 : command("aggr", "subvariance", AGGRsubvariance_dbl, false, "Grouped variance (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1523 : command("aggr", "subvariance", AGGRsubvariancecand_dbl, false, "Grouped variance (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1524 : command("aggr", "variancep", AGGRvariancep3_dbl, false, "Grouped tail variance (population/biased) on lng", args(1,4, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1))),
1525 : command("aggr", "subvariancep", AGGRsubvariancep_dbl, false, "Grouped variance (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1526 : command("aggr", "subvariancep", AGGRsubvariancepcand_dbl, false, "Grouped variance (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1527 : command("aggr", "covariance", AGGRcovariance, false, "Covariance sample aggregate", args(1,5, batarg("",dbl),batarg("b1",lng),batarg("b2",lng),batarg("g",oid),batargany("e",1))),
1528 : command("aggr", "subcovariance", AGGRsubcovariance, false, "Grouped covariance sample aggregate", args(1,6, batarg("",dbl),batarg("b1",lng),batarg("b2",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1529 : command("aggr", "subcovariance", AGGRsubcovariancecand, false, "Grouped covariance sample aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",lng),batarg("b2",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1530 : command("aggr", "covariancep", AGGRcovariancep, false, "Covariance population aggregate", args(1,5, batarg("",dbl),batarg("b1",lng),batarg("b2",lng),batarg("g",oid),batargany("e",1))),
1531 : command("aggr", "subcovariancep", AGGRsubcovariancep, false, "Grouped covariance population aggregate", args(1,6, batarg("",dbl),batarg("b1",lng),batarg("b2",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1532 : command("aggr", "subcovariancep", AGGRsubcovariancepcand, false, "Grouped covariance population aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",lng),batarg("b2",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1533 : command("aggr", "corr", AGGRcorr, false, "Correlation aggregate", args(1,5, batarg("",dbl),batarg("b1",lng),batarg("b2",lng),batarg("g",oid),batargany("e",1))),
1534 : command("aggr", "subcorr", AGGRsubcorr, false, "Grouped correlation aggregate", args(1,6, batarg("",dbl),batarg("b1",lng),batarg("b2",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1535 : command("aggr", "subcorr", AGGRsubcorrcand, false, "Grouped correlation aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",lng),batarg("b2",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1536 : command("aggr", "avg", AGGRavg13_dbl, false, "Grouped tail average on flt", args(1,4, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1))),
1537 : command("aggr", "avg", AGGRavg23_dbl, false, "Grouped tail average on flt, also returns count", args(2,5, batarg("",dbl),batarg("",lng),batarg("b",flt),batarg("g",oid),batargany("e",1))),
1538 : command("aggr", "avg", AGGRavg14_dbl, false, "Grouped tail average on flt", args(1,5, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("scale",int))),
1539 : command("aggr", "avg", AGGRavg24_dbl, false, "Grouped tail average on flt, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("scale",int))),
1540 : command("aggr", "subavg", AGGRsubavg1_dbl, false, "Grouped average aggregate", args(1,5, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1541 : command("aggr", "subavg", AGGRsubavg1cand_dbl, false, "Grouped average aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1542 : command("aggr", "subavg", AGGRsubavg2_dbl, false, "Grouped average aggregate, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1543 : command("aggr", "subavg", AGGRsubavg2cand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1544 : command("aggr", "subavg", AGGRsubavg1s_dbl, false, "Grouped average aggregate", args(1,6, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1545 : command("aggr", "subavg", AGGRsubavg1scand_dbl, false, "Grouped average aggregate with candidates list", args(1,7, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1546 : command("aggr", "subavg", AGGRsubavg2s_dbl, false, "Grouped average aggregate, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1547 : command("aggr", "subavg", AGGRsubavg2scand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,8, batarg("",dbl),batarg("",lng),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1548 : command("aggr", "stdev", AGGRstdev3_dbl, false, "Grouped tail standard deviation (sample/non-biased) on flt", args(1,4, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1))),
1549 : command("aggr", "substdev", AGGRsubstdev_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1550 : command("aggr", "substdev", AGGRsubstdevcand_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1551 : command("aggr", "stdevp", AGGRstdevp3_dbl, false, "Grouped tail standard deviation (population/biased) on flt", args(1,4, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1))),
1552 : command("aggr", "substdevp", AGGRsubstdevp_dbl, false, "Grouped standard deviation (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1553 : command("aggr", "substdevp", AGGRsubstdevpcand_dbl, false, "Grouped standard deviation (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1554 : command("aggr", "variance", AGGRvariance3_dbl, false, "Grouped tail variance (sample/non-biased) on flt", args(1,4, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1))),
1555 : command("aggr", "subvariance", AGGRsubvariance_dbl, false, "Grouped variance (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1556 : command("aggr", "subvariance", AGGRsubvariancecand_dbl, false, "Grouped variance (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1557 : command("aggr", "variancep", AGGRvariancep3_dbl, false, "Grouped tail variance (population/biased) on flt", args(1,4, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1))),
1558 : command("aggr", "subvariancep", AGGRsubvariancep_dbl, false, "Grouped variance (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1559 : command("aggr", "subvariancep", AGGRsubvariancepcand_dbl, false, "Grouped variance (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1560 : command("aggr", "covariance", AGGRcovariance, false, "Covariance sample aggregate", args(1,5, batarg("",dbl),batarg("b1",flt),batarg("b2",flt),batarg("g",oid),batargany("e",1))),
1561 : command("aggr", "subcovariance", AGGRsubcovariance, false, "Grouped covariance sample aggregate", args(1,6, batarg("",dbl),batarg("b1",flt),batarg("b2",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1562 : command("aggr", "subcovariance", AGGRsubcovariancecand, false, "Grouped covariance sample aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",flt),batarg("b2",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1563 : command("aggr", "covariancep", AGGRcovariancep, false, "Covariance population aggregate", args(1,5, batarg("",dbl),batarg("b1",flt),batarg("b2",flt),batarg("g",oid),batargany("e",1))),
1564 : command("aggr", "subcovariancep", AGGRsubcovariancep, false, "Grouped covariance population aggregate", args(1,6, batarg("",dbl),batarg("b1",flt),batarg("b2",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1565 : command("aggr", "subcovariancep", AGGRsubcovariancepcand, false, "Grouped covariance population aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",flt),batarg("b2",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1566 : command("aggr", "corr", AGGRcorr, false, "Correlation aggregate", args(1,5, batarg("",dbl),batarg("b1",flt),batarg("b2",flt),batarg("g",oid),batargany("e",1))),
1567 : command("aggr", "subcorr", AGGRsubcorr, false, "Grouped correlation aggregate", args(1,6, batarg("",dbl),batarg("b1",flt),batarg("b2",flt),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1568 : command("aggr", "subcorr", AGGRsubcorrcand, false, "Grouped correlation aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",flt),batarg("b2",flt),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1569 : command("aggr", "avg", AGGRavg13_dbl, false, "Grouped tail average on dbl", args(1,4, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1))),
1570 : command("aggr", "avg", AGGRavg23_dbl, false, "Grouped tail average on dbl, also returns count", args(2,5, batarg("",dbl),batarg("",lng),batarg("b",dbl),batarg("g",oid),batargany("e",1))),
1571 : command("aggr", "avg", AGGRavg14_dbl, false, "Grouped tail average on dbl", args(1,5, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("scale",int))),
1572 : command("aggr", "avg", AGGRavg24_dbl, false, "Grouped tail average on dbl, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("scale",int))),
1573 : command("aggr", "subavg", AGGRsubavg1_dbl, false, "Grouped average aggregate", args(1,5, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1574 : command("aggr", "subavg", AGGRsubavg1cand_dbl, false, "Grouped average aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1575 : command("aggr", "subavg", AGGRsubavg2_dbl, false, "Grouped average aggregate, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1576 : command("aggr", "subavg", AGGRsubavg2cand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1577 : command("aggr", "subavg", AGGRsubavg1s_dbl, false, "Grouped average aggregate", args(1,6, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1578 : command("aggr", "subavg", AGGRsubavg1scand_dbl, false, "Grouped average aggregate with candidates list", args(1,7, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1579 : command("aggr", "subavg", AGGRsubavg2s_dbl, false, "Grouped average aggregate, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit),arg("scale",int))),
1580 : command("aggr", "subavg", AGGRsubavg2scand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,8, batarg("",dbl),batarg("",lng),batarg("b",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit),arg("scale",int))),
1581 : command("aggr", "stdev", AGGRstdev3_dbl, false, "Grouped tail standard deviation (sample/non-biased) on dbl", args(1,4, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1))),
1582 : command("aggr", "substdev", AGGRsubstdev_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1583 : command("aggr", "substdev", AGGRsubstdevcand_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1584 : command("aggr", "stdevp", AGGRstdevp3_dbl, false, "Grouped tail standard deviation (population/biased) on dbl", args(1,4, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1))),
1585 : command("aggr", "substdevp", AGGRsubstdevp_dbl, false, "Grouped standard deviation (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1586 : command("aggr", "substdevp", AGGRsubstdevpcand_dbl, false, "Grouped standard deviation (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1587 : command("aggr", "variance", AGGRvariance3_dbl, false, "Grouped tail variance (sample/non-biased) on dbl", args(1,4, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1))),
1588 : command("aggr", "subvariance", AGGRsubvariance_dbl, false, "Grouped variance (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1589 : command("aggr", "subvariance", AGGRsubvariancecand_dbl, false, "Grouped variance (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1590 : command("aggr", "variancep", AGGRvariancep3_dbl, false, "Grouped tail variance (population/biased) on dbl", args(1,4, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1))),
1591 : command("aggr", "subvariancep", AGGRsubvariancep_dbl, false, "Grouped variance (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1592 : command("aggr", "subvariancep", AGGRsubvariancepcand_dbl, false, "Grouped variance (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1593 : command("aggr", "covariance", AGGRcovariance, false, "Covariance sample aggregate", args(1,5, batarg("",dbl),batarg("b1",dbl),batarg("b2",dbl),batarg("g",oid),batargany("e",1))),
1594 : command("aggr", "subcovariance", AGGRsubcovariance, false, "Grouped covariance sample aggregate", args(1,6, batarg("",dbl),batarg("b1",dbl),batarg("b2",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1595 : command("aggr", "subcovariance", AGGRsubcovariancecand, false, "Grouped covariance sample aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",dbl),batarg("b2",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1596 : command("aggr", "covariancep", AGGRcovariancep, false, "Covariance population aggregate", args(1,5, batarg("",dbl),batarg("b1",dbl),batarg("b2",dbl),batarg("g",oid),batargany("e",1))),
1597 : command("aggr", "subcovariancep", AGGRsubcovariancep, false, "Grouped covariance population aggregate", args(1,6, batarg("",dbl),batarg("b1",dbl),batarg("b2",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1598 : command("aggr", "subcovariancep", AGGRsubcovariancepcand, false, "Grouped covariance population aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",dbl),batarg("b2",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1599 : command("aggr", "corr", AGGRcorr, false, "Correlation aggregate", args(1,5, batarg("",dbl),batarg("b1",dbl),batarg("b2",dbl),batarg("g",oid),batargany("e",1))),
1600 : command("aggr", "subcorr", AGGRsubcorr, false, "Grouped correlation aggregate", args(1,6, batarg("",dbl),batarg("b1",dbl),batarg("b2",dbl),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1601 : command("aggr", "subcorr", AGGRsubcorrcand, false, "Grouped correlation aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",dbl),batarg("b2",dbl),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1602 : command("aggr", "min", AGGRmin3, false, "", args(1,4, batargany("",1),batargany("b",1),batarg("g",oid),batargany("e",2))),
1603 : command("aggr", "max", AGGRmax3, false, "", args(1,4, batargany("",1),batargany("b",1),batarg("g",oid),batargany("e",2))),
1604 : command("aggr", "submin", AGGRsubmin, false, "Grouped minimum aggregate", args(1,5, batarg("",oid),batargany("b",1),batarg("g",oid),batargany("e",2),arg("skip_nils",bit))),
1605 : command("aggr", "submin", AGGRsubmincand, false, "Grouped minimum aggregate with candidates list", args(1,6, batarg("",oid),batargany("b",1),batarg("g",oid),batargany("e",2),batarg("s",oid),arg("skip_nils",bit))),
1606 : command("aggr", "submax", AGGRsubmax, false, "Grouped maximum aggregate", args(1,5, batarg("",oid),batargany("b",1),batarg("g",oid),batargany("e",2),arg("skip_nils",bit))),
1607 : command("aggr", "submax", AGGRsubmaxcand, false, "Grouped maximum aggregate with candidates list", args(1,6, batarg("",oid),batargany("b",1),batarg("g",oid),batargany("e",2),batarg("s",oid),arg("skip_nils",bit))),
1608 : command("aggr", "submin", AGGRsubmin_val, false, "Grouped minimum aggregate", args(1,5, batargany("",1),batargany("b",1),batarg("g",oid),batargany("e",2),arg("skip_nils",bit))),
1609 : command("aggr", "submin", AGGRsubmincand_val, false, "Grouped minimum aggregate with candidates list", args(1,6, batargany("",1),batargany("b",1),batarg("g",oid),batargany("e",2),batarg("s",oid),arg("skip_nils",bit))),
1610 : command("aggr", "submax", AGGRsubmax_val, false, "Grouped maximum aggregate", args(1,5, batargany("",1),batargany("b",1),batarg("g",oid),batargany("e",2),arg("skip_nils",bit))),
1611 : command("aggr", "submax", AGGRsubmaxcand_val, false, "Grouped maximum aggregate with candidates list", args(1,6, batargany("",1),batargany("b",1),batarg("g",oid),batargany("e",2),batarg("s",oid),arg("skip_nils",bit))),
1612 : command("aggr", "count", AGGRcount3, false, "", args(1,5, batarg("",lng),batargany("b",1),batarg("g",oid),batargany("e",2),arg("ignorenils",bit))),
1613 : command("aggr", "count", AGGRcount3nils, false, "Grouped count", args(1,4, batarg("",lng),batargany("b",1),batarg("g",oid),batargany("e",2))),
1614 : command("aggr", "count_no_nil", AGGRcount3nonils, false, "", args(1,4, batarg("",lng),batargany("b",1),batarg("g",oid),batargany("e",2))),
1615 : command("aggr", "subcount", AGGRsubcount, false, "Grouped count aggregate", args(1,5, batarg("",lng),batargany("b",1),batarg("g",oid),batargany("e",2),arg("skip_nils",bit))),
1616 : command("aggr", "subcount", AGGRsubcountcand, false, "Grouped count aggregate with candidates list", args(1,6, batarg("",lng),batargany("b",1),batarg("g",oid),batargany("e",2),batarg("s",oid),arg("skip_nils",bit))),
1617 : command("aggr", "median", AGGRmedian, false, "Median aggregate", args(1,2, argany("",1),batargany("b",1))),
1618 : command("aggr", "submedian", AGGRsubmedian, false, "Grouped median aggregate", args(1,5, batargany("",1),batargany("b",1),batarg("g",oid),batargany("e",2),arg("skip_nils",bit))),
1619 : command("aggr", "submedian", AGGRsubmediancand, false, "Grouped median aggregate with candidate list", args(1,6, batargany("",1),batargany("b",1),batarg("g",oid),batargany("e",2),batarg("s",oid),arg("skip_nils",bit))),
1620 : command("aggr", "quantile", AGGRquantile, false, "Quantile aggregate", args(1,3, argany("",1),batargany("b",1),batarg("q",dbl))),
1621 : command("aggr", "quantile", AGGRquantile_cst, false, "Quantile aggregate", args(1,3, argany("",1),batargany("b",1),arg("q",dbl))),
1622 : command("aggr", "subquantile", AGGRsubquantile, false, "Grouped quantile aggregate", args(1,6, batargany("",1),batargany("b",1),batarg("q",dbl),batarg("g",oid),batargany("e",2),arg("skip_nils",bit))),
1623 : command("aggr", "subquantile", AGGRsubquantilecand, false, "Grouped quantile aggregate with candidate list", args(1,7, batargany("",1),batargany("b",1),batarg("q",dbl),batarg("g",oid),batargany("e",2),batarg("s",oid),arg("skip_nils",bit))),
1624 : command("aggr", "median_avg", AGGRmedian_avg, false, "Median aggregate", args(1,2, arg("",dbl),batargany("b",1))),
1625 : command("aggr", "submedian_avg", AGGRsubmedian_avg, false, "Grouped median aggregate", args(1,5, batarg("",dbl),batargany("b",1),batarg("g",oid),batargany("e",2),arg("skip_nils",bit))),
1626 : command("aggr", "submedian_avg", AGGRsubmediancand_avg, false, "Grouped median aggregate with candidate list", args(1,6, batarg("",dbl),batargany("b",1),batarg("g",oid),batargany("e",2),batarg("s",oid),arg("skip_nils",bit))),
1627 : command("aggr", "quantile_avg", AGGRquantile_avg, false, "Quantile aggregate", args(1,3, arg("",dbl),batargany("b",1),batarg("q",dbl))),
1628 : command("aggr", "quantile_avg", AGGRquantile_avg_cst, false, "Quantile aggregate", args(1,3, arg("",dbl),batargany("b",1),arg("q",dbl))),
1629 : command("aggr", "subquantile_avg", AGGRsubquantile_avg, false, "Grouped quantile aggregate", args(1,6, batarg("",dbl),batargany("b",1),batarg("q",dbl),batarg("g",oid),batargany("e",2),arg("skip_nils",bit))),
1630 : command("aggr", "subquantile_avg", AGGRsubquantilecand_avg, false, "Grouped quantile aggregate with candidate list", args(1,7, batarg("",dbl),batargany("b",1),batarg("q",dbl),batarg("g",oid),batargany("e",2),batarg("s",oid),arg("skip_nils",bit))),
1631 : command("aggr", "str_group_concat", AGGRstr_group_concat, false, "Grouped string tail concat", args(1,4, batarg("",str),batarg("b",str),batarg("g",oid),batargany("e",1))),
1632 : command("aggr", "substr_group_concat", AGGRsubstr_group_concat, false, "Grouped string concat", args(1,5, batarg("",str),batarg("b",str),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1633 : command("aggr", "substr_group_concat", AGGRsubstr_group_concatcand, false, "Grouped string concat with candidates list", args(1,6, batarg("",str),batarg("b",str),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1634 : command("aggr", "str_group_concat", AGGRstr_group_concat_sep, false, "Grouped string tail concat with custom separator", args(1,5, batarg("",str),batarg("b",str),batarg("sep",str),batarg("g",oid),batargany("e",1))),
1635 : command("aggr", "substr_group_concat", AGGRsubstr_group_concat_sep, false, "Grouped string concat with custom separator", args(1,6, batarg("",str),batarg("b",str),batarg("sep",str),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1636 : command("aggr", "substr_group_concat", AGGRsubstr_group_concatcand_sep, false, "Grouped string concat with candidates list with custom separator", args(1,7, batarg("",str),batarg("b",str),batarg("sep",str),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1637 :
1638 : command("aggr", "subavg", AGGRavg3, false, "Grouped average aggregation", args(3,8, batarg("",bte),batarg("",lng),batarg("",lng),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1639 : command("aggr", "subavg", AGGRavg3, false, "Grouped average aggregation", args(3,8, batarg("",sht),batarg("",lng),batarg("",lng),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1640 : command("aggr", "subavg", AGGRavg3, false, "Grouped average aggregation", args(3,8, batarg("",int),batarg("",lng),batarg("",lng),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1641 : command("aggr", "subavg", AGGRavg3, false, "Grouped average aggregation", args(3,8, batarg("",lng),batarg("",lng),batarg("",lng),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1642 : #ifdef HAVE_HGE
1643 : command("aggr", "subavg", AGGRavg3, false, "Grouped average aggregation", args(3,8, batarg("",hge),batarg("",lng),batarg("",lng),batarg("b",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1644 : #endif
1645 : command("aggr", "subavg", AGGRavg3comb, false, "Grouped average aggregation combiner", args(1,7, batarg("",bte),batarg("b",bte),batarg("r",lng),batarg("c",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1646 : command("aggr", "subavg", AGGRavg3comb, false, "Grouped average aggregation combiner", args(1,7, batarg("",sht),batarg("b",sht),batarg("r",lng),batarg("c",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1647 : command("aggr", "subavg", AGGRavg3comb, false, "Grouped average aggregation combiner", args(1,7, batarg("",int),batarg("b",int),batarg("r",lng),batarg("c",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1648 : command("aggr", "subavg", AGGRavg3comb, false, "Grouped average aggregation combiner", args(1,7, batarg("",lng),batarg("b",lng),batarg("r",lng),batarg("c",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1649 : #ifdef HAVE_HGE
1650 : command("aggr", "subavg", AGGRavg3comb, false, "Grouped average aggregation combiner", args(1,7, batarg("",hge),batarg("b",hge),batarg("r",lng),batarg("c",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1651 : #endif
1652 :
1653 : #ifdef HAVE_HGE
1654 : command("aggr", "sum", AGGRsum3_hge, false, "Grouped tail sum on bte", args(1,4, batarg("",hge),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1655 : command("aggr", "subsum", AGGRsubsum_hge, false, "Grouped sum aggregate", args(1,5, batarg("",hge),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1656 : command("aggr", "subsum", AGGRsubsumcand_hge, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",hge),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1657 : command("aggr", "prod", AGGRprod3_hge, false, "Grouped tail product on bte", args(1,4, batarg("",hge),batarg("b",bte),batarg("g",oid),batargany("e",1))),
1658 : command("aggr", "subprod", AGGRsubprod_hge, false, "Grouped product aggregate", args(1,5, batarg("",hge),batarg("b",bte),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1659 : command("aggr", "subprod", AGGRsubprodcand_hge, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",hge),batarg("b",bte),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1660 : command("aggr", "sum", AGGRsum3_hge, false, "Grouped tail sum on sht", args(1,4, batarg("",hge),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1661 : command("aggr", "subsum", AGGRsubsum_hge, false, "Grouped sum aggregate", args(1,5, batarg("",hge),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1662 : command("aggr", "subsum", AGGRsubsumcand_hge, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",hge),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1663 : command("aggr", "prod", AGGRprod3_hge, false, "Grouped tail product on sht", args(1,4, batarg("",hge),batarg("b",sht),batarg("g",oid),batargany("e",1))),
1664 : command("aggr", "subprod", AGGRsubprod_hge, false, "Grouped product aggregate", args(1,5, batarg("",hge),batarg("b",sht),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1665 : command("aggr", "subprod", AGGRsubprodcand_hge, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",hge),batarg("b",sht),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1666 : command("aggr", "sum", AGGRsum3_hge, false, "Grouped tail sum on int", args(1,4, batarg("",hge),batarg("b",int),batarg("g",oid),batargany("e",1))),
1667 : command("aggr", "subsum", AGGRsubsum_hge, false, "Grouped sum aggregate", args(1,5, batarg("",hge),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1668 : command("aggr", "subsum", AGGRsubsumcand_hge, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",hge),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1669 : command("aggr", "prod", AGGRprod3_hge, false, "Grouped tail product on int", args(1,4, batarg("",hge),batarg("b",int),batarg("g",oid),batargany("e",1))),
1670 : command("aggr", "subprod", AGGRsubprod_hge, false, "Grouped product aggregate", args(1,5, batarg("",hge),batarg("b",int),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1671 : command("aggr", "subprod", AGGRsubprodcand_hge, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",hge),batarg("b",int),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1672 : command("aggr", "sum", AGGRsum3_hge, false, "Grouped tail sum on lng", args(1,4, batarg("",hge),batarg("b",lng),batarg("g",oid),batargany("e",1))),
1673 : command("aggr", "subsum", AGGRsubsum_hge, false, "Grouped sum aggregate", args(1,5, batarg("",hge),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1674 : command("aggr", "subsum", AGGRsubsumcand_hge, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",hge),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1675 : command("aggr", "prod", AGGRprod3_hge, false, "Grouped tail product on lng", args(1,4, batarg("",hge),batarg("b",lng),batarg("g",oid),batargany("e",1))),
1676 : command("aggr", "subprod", AGGRsubprod_hge, false, "Grouped product aggregate", args(1,5, batarg("",hge),batarg("b",lng),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1677 : command("aggr", "subprod", AGGRsubprodcand_hge, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",hge),batarg("b",lng),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1678 : command("aggr", "sum", AGGRsum3_hge, false, "Grouped tail sum on hge", args(1,4, batarg("",hge),batarg("b",hge),batarg("g",oid),batargany("e",1))),
1679 : command("aggr", "subsum", AGGRsubsum_hge, false, "Grouped sum aggregate", args(1,5, batarg("",hge),batarg("b",hge),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1680 : command("aggr", "subsum", AGGRsubsumcand_hge, false, "Grouped sum aggregate with candidates list", args(1,6, batarg("",hge),batarg("b",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1681 : command("aggr", "prod", AGGRprod3_hge, false, "Grouped tail product on hge", args(1,4, batarg("",hge),batarg("b",hge),batarg("g",oid),batargany("e",1))),
1682 : command("aggr", "subprod", AGGRsubprod_hge, false, "Grouped product aggregate", args(1,5, batarg("",hge),batarg("b",hge),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1683 : command("aggr", "subprod", AGGRsubprodcand_hge, false, "Grouped product aggregate with candidates list", args(1,6, batarg("",hge),batarg("b",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1684 : command("aggr", "avg", AGGRavg13_dbl, false, "Grouped tail average on hge", args(1,4, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1))),
1685 : command("aggr", "avg", AGGRavg23_dbl, false, "Grouped tail average on hge, also returns count", args(2,5, batarg("",dbl),batarg("",lng),batarg("b",hge),batarg("g",oid),batargany("e",1))),
1686 : command("aggr", "subavg", AGGRsubavg1_dbl, false, "Grouped average aggregate", args(1,5, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1687 : command("aggr", "subavg", AGGRsubavg1cand_dbl, false, "Grouped average aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1688 : command("aggr", "subavg", AGGRsubavg2_dbl, false, "Grouped average aggregate, also returns count", args(2,6, batarg("",dbl),batarg("",lng),batarg("b",hge),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1689 : command("aggr", "subavg", AGGRsubavg2cand_dbl, false, "Grouped average aggregate with candidates list, also returns count", args(2,7, batarg("",dbl),batarg("",lng),batarg("b",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1690 : command("aggr", "stdev", AGGRstdev3_dbl, false, "Grouped tail standard deviation (sample/non-biased) on hge", args(1,4, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1))),
1691 : command("aggr", "substdev", AGGRsubstdev_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1692 : command("aggr", "substdev", AGGRsubstdevcand_dbl, false, "Grouped standard deviation (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1693 : command("aggr", "stdevp", AGGRstdevp3_dbl, false, "Grouped tail standard deviation (population/biased) on hge", args(1,4, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1))),
1694 : command("aggr", "substdevp", AGGRsubstdevp_dbl, false, "Grouped standard deviation (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1695 : command("aggr", "substdevp", AGGRsubstdevpcand_dbl, false, "Grouped standard deviation (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1696 : command("aggr", "variance", AGGRvariance3_dbl, false, "Grouped tail variance (sample/non-biased) on hge", args(1,4, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1))),
1697 : command("aggr", "subvariance", AGGRsubvariance_dbl, false, "Grouped variance (sample/non-biased) aggregate", args(1,5, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1698 : command("aggr", "subvariance", AGGRsubvariancecand_dbl, false, "Grouped variance (sample/non-biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1699 : command("aggr", "variancep", AGGRvariancep3_dbl, false, "Grouped tail variance (population/biased) on hge", args(1,4, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1))),
1700 : command("aggr", "subvariancep", AGGRsubvariancep_dbl, false, "Grouped variance (population/biased) aggregate", args(1,5, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1701 : command("aggr", "subvariancep", AGGRsubvariancepcand_dbl, false, "Grouped variance (population/biased) aggregate with candidates list", args(1,6, batarg("",dbl),batarg("b",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1702 : command("aggr", "covariance", AGGRcovariance, false, "Covariance sample aggregate", args(1,5, batarg("",dbl),batarg("b1",hge),batarg("b2",hge),batarg("g",oid),batargany("e",1))),
1703 : command("aggr", "subcovariance", AGGRsubcovariance, false, "Grouped covariance sample aggregate", args(1,6, batarg("",dbl),batarg("b1",hge),batarg("b2",hge),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1704 : command("aggr", "subcovariance", AGGRsubcovariancecand, false, "Grouped covariance sample aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",hge),batarg("b2",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1705 : command("aggr", "covariancep", AGGRcovariancep, false, "Covariance population aggregate", args(1,5, batarg("",dbl),batarg("b1",hge),batarg("b2",hge),batarg("g",oid),batargany("e",1))),
1706 : command("aggr", "subcovariancep", AGGRsubcovariancep, false, "Grouped covariance population aggregate", args(1,6, batarg("",dbl),batarg("b1",hge),batarg("b2",hge),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1707 : command("aggr", "subcovariancep", AGGRsubcovariancepcand, false, "Grouped covariance population aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",hge),batarg("b2",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1708 : command("aggr", "corr", AGGRcorr, false, "Correlation aggregate", args(1,5, batarg("",dbl),batarg("b1",hge),batarg("b2",hge),batarg("g",oid),batargany("e",1))),
1709 : command("aggr", "subcorr", AGGRsubcorr, false, "Grouped correlation aggregate", args(1,6, batarg("",dbl),batarg("b1",hge),batarg("b2",hge),batarg("g",oid),batargany("e",1),arg("skip_nils",bit))),
1710 : command("aggr", "subcorr", AGGRsubcorrcand, false, "Grouped correlation aggregate with candidate list", args(1,7, batarg("",dbl),batarg("b1",hge),batarg("b2",hge),batarg("g",oid),batargany("e",1),batarg("s",oid),arg("skip_nils",bit))),
1711 : #endif
1712 : { .imp=NULL }
1713 : };
1714 : #include "mal_import.h"
1715 : #ifdef _MSC_VER
1716 : #undef read
1717 : #pragma section(".CRT$XCU",read)
1718 : #endif
1719 321 : LIB_STARTUP_FUNC(init_aggr_mal)
1720 321 : { mal_module("aggr", NULL, aggr_init_funcs); }
|