Changeset: 9ce1cdf5edbc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9ce1cdf5edbc
Modified Files:
monetdb5/modules/mal/pp_algebra.c
Branch: pp_hashjoin
Log Message:
whitespaces to tab, removed extra whitespaces
diffs (truncated from 427 to 300 lines):
diff --git a/monetdb5/modules/mal/pp_algebra.c
b/monetdb5/modules/mal/pp_algebra.c
--- a/monetdb5/modules/mal/pp_algebra.c
+++ b/monetdb5/modules/mal/pp_algebra.c
@@ -30,9 +30,9 @@
#define inet4_min(a,b) ((cmp((void*)&a,(void*)&b)<0)?a:b)
#define inet4_max(a,b) ((cmp((void*)&a,(void*)&b)>0)?a:b)
-#define getArgReference_date(stk, pci, nr) (date*)getArgReference(stk,
pci, nr)
-#define getArgReference_inet4(stk, pci, nr) (inet4*)getArgReference(stk,
pci, nr)
-#define getArgReference_daytime(stk, pci, nr) (daytime*)getArgReference(stk,
pci, nr)
+#define getArgReference_date(stk, pci, nr) (date*)getArgReference(stk, pci, nr)
+#define getArgReference_inet4(stk, pci, nr) (inet4*)getArgReference(stk, pci,
nr)
+#define getArgReference_daytime(stk, pci, nr) (daytime*)getArgReference(stk,
pci, nr)
#define getArgReference_timestamp(stk, pci, nr)
(timestamp*)getArgReference(stk, pci, nr)
#define aggr(T,f)
\
@@ -249,7 +249,7 @@ LOCKEDAGGRprod(Client cntxt, MalBlkPtr m
t[0] = val;
\
tcnt[0] = cnt;
\
} else {
\
- dbl tt = (dbl) (tcnt[0] + cnt);
\
+ dbl tt = (dbl) (tcnt[0] + cnt);
\
t[0] = (T) ((t[0]*((dbl)tcnt[0]/tt)) +
(val*((dbl)cnt/tt))); \
tcnt[0] += cnt;
\
}
\
@@ -523,7 +523,7 @@ mulmod(lng a, lng b, lng c)
overflow += (is_##T##_nil(a1)?(int)n1:0);
\
n2 = n1;
\
} else if (!is_##T##_nil(a1)) {
\
- T t = a2 + a1;
\
+ T t = a2 + a1;
\
if (fabs(a2) >= fabs(a1))
\
e2 += (a2 - t) + a1;
\
else
\
@@ -967,10 +967,10 @@ LOCKEDAGGRnull(Client ctx, bat *result,
}
#define unique(Type) \
- unique_(Type, \
+ unique_(Type, \
Type, \
, \
- Type *bp = Tloc(b, 0), \
+ Type *bp = Tloc(b, 0), \
, \
(gid)_hash_##Type(bp[i]), \
vals[g] != bp[i], \
@@ -983,7 +983,7 @@ LOCKEDAGGRnull(Client ctx, bat *result,
unique_(Type, \
BaseType, \
, \
- Type *bp = Tloc(b, 0), \
+ Type *bp = Tloc(b, 0), \
, \
(gid)_hash_##Type(*(((BaseType*)bp)+i)), \
(!(is_##Type##_nil(bp[i]) && is_##Type##_nil(vals[g]))
&& vals[g] != bp[i]), \
@@ -996,7 +996,7 @@ LOCKEDAGGRnull(Client ctx, bat *result,
unique_(Type, \
BaseType, \
, \
- Type *bp = Tloc(b, 0), \
+ Type *bp = Tloc(b, 0), \
, \
(gid)_hash_##Type(*(((BaseType*)bp)+i)), \
(!(is_##Type##_nil(bp[i]) && is_##Type##_nil(vals[g]))
&& h->cmp(vals+g, bp+i) != 0), \
@@ -1218,10 +1218,10 @@ LALGunique(Client ctx, bat *rid, bat *ui
}
#define gunique(Type) \
- gunique_(Type, \
+ gunique_(Type, \
Type, \
, \
- Type *bp = Tloc(b, 0), \
+ Type *bp = Tloc(b, 0), \
, \
(gid)_hash_##Type(bp[i]), \
vals[g] != bp[i], \
@@ -1234,7 +1234,7 @@ LALGunique(Client ctx, bat *rid, bat *ui
gunique_(Type, \
BaseType, \
, \
- Type *bp = Tloc(b, 0), \
+ Type *bp = Tloc(b, 0), \
, \
(gid)_hash_##Type(*(((BaseType*)bp)+i)), \
(!(is_##Type##_nil(bp[i]) && is_##Type##_nil(vals[g]))
&& vals[g] != bp[i]), \
@@ -1247,7 +1247,7 @@ LALGunique(Client ctx, bat *rid, bat *ui
gunique_(Type, \
BaseType, \
, \
- Type *bp = Tloc(b, 0), \
+ Type *bp = Tloc(b, 0), \
, \
(gid)_hash_##Type(*(((BaseType*)bp)+i)), \
(!(is_##Type##_nil(bp[i]) && is_##Type##_nil(vals[g]))
&& h->cmp(vals+g, bp+i) != 0), \
@@ -1471,7 +1471,7 @@ LALGgroup_unique(Client ctx, bat *rid, b
group_(Type, \
Type, \
, \
- Type *bp = Tloc(b, 0), \
+ Type *bp = Tloc(b, 0), \
, \
(gid)_hash_##Type(bp[i]), \
vals[g] != bp[i], \
@@ -1545,7 +1545,7 @@ LALGgroup_unique(Client ctx, bat *rid, b
group_(Type, \
BaseType, \
, \
- Type *bp = Tloc(b, 0), \
+ Type *bp = Tloc(b, 0), \
, \
(gid)_hash_##Type(*(((BaseType*)bp)+i)), \
(!(is_##Type##_nil(bp[i]) && is_##Type##_nil(vals[g]))
&& vals[g] != bp[i]), \
@@ -1598,7 +1598,7 @@ LALGgroup_unique(Client ctx, bat *rid, b
}
#define afgroup() \
- assert(h->hsh && h->cmp); \
+ assert(h->hsh && h->cmp); \
int w = b->twidth; \
group_(char, \
char, \
@@ -1810,7 +1810,7 @@ LALGgroup(Client ctx, bat *rid, bat *uid
derive_(Type, \
Type, \
, \
- Type *bp = Tloc(b, 0), \
+ Type *bp = Tloc(b, 0), \
, \
(gid)_hash_##Type(bp[i]), \
vals[g] != bp[i], \
@@ -1841,7 +1841,7 @@ LALGgroup(Client ctx, bat *rid, bat *uid
derive_(Type, \
BaseType, \
, \
- Type *bp = Tloc(b, 0), \
+ Type *bp = Tloc(b, 0), \
, \
(gid)_hash_##Type(*(((BaseType*)bp)+i)), \
(!(is_##Type##_nil(bp[i]) && is_##Type##_nil(vals[g]))
&& vals[g] != bp[i]), \
@@ -2147,7 +2147,7 @@ LALGderive(Client ctx, bat *rid, bat *ui
} \
} while(0)
-/* inout := algebra.project(groupid, val) */
+/* inout := algebra.project(groupid, val) */
/* this (possibly) overwrites the values, therefor for expensive (var) types we
* only write offsets (ie use the heap from the parent) */
static str
@@ -2362,7 +2362,7 @@ LALGconstant(Client ctx, MalBlkPtr mb, M
bat_iterator_end(&bi); \
}
-/* result := ialgebra.projection(groupid, input) */
+/* result := ialgebra.projection(groupid, input) */
/* this (possibly) overwrites the values, therefor for expensive (var) types we
* only write offsets (ie use the heap from the parent) */
static str
@@ -2648,7 +2648,7 @@ LALGcountstar(Client ctx, bat *rid, bat
#define gfcount(Type) \
if (tt == TYPE_##Type) { \
Type *in = Tloc(b, 0); \
- int (*cmp)(const void *v1,const void *v2) =
ATOMcompare(tt); \
+ int (*cmp)(const void *v1,const void *v2) =
ATOMcompare(tt); \
TIMEOUT_LOOP_IDX_DECL(i, cnt, qry_ctx) \
o[v[i]]+= cmp(in+i, &Type##_nil) != 0; \
}
@@ -2657,7 +2657,7 @@ LALGcountstar(Client ctx, bat *rid, bat
if (tt == TYPE_##Type) { \
BATiter bi = bat_iterator(b); \
const void *nil = ATOMnilptr(tt); \
- int (*cmp)(const void *v1,const void *v2) =
ATOMcompare(tt); \
+ int (*cmp)(const void *v1,const void *v2) =
ATOMcompare(tt); \
TIMEOUT_LOOP_IDX_DECL(i, cnt, qry_ctx) { \
o[v[i]]+= cmp(BUNtvar(&bi, i), nil)!=0; \
} \
@@ -2678,13 +2678,13 @@ LALGcount(Client ctx, bat *rid, bat *gid
g = BATdescriptor(*gid);
b = BATdescriptor(*bid);
if (g == NULL || b == NULL) {
- err = createException(MAL, "ilockedaggr.count",
SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
+ err = createException(MAL, "ilockedaggr.count", SQLSTATE(HY002)
RUNTIME_OBJECT_MISSING);
goto error;
}
if (!is_bat_nil(*rid)) {
if ((r = BATdescriptor(*rid)) == NULL) {
- err = createException(MAL, "ilockedaggr.count",
SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
+ err = createException(MAL, "ilockedaggr.count",
SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
goto error;
}
}
@@ -2809,12 +2809,12 @@ LALGsum(Client cntxt, MalBlkPtr mb, MalS
g = BATdescriptor(*gid);
b = BATdescriptor(*bid);
if (g == NULL || b == NULL) {
- err = createException(MAL, "ilockedaggr.sum", SQLSTATE(HY002)
RUNTIME_OBJECT_MISSING);
+ err = createException(MAL, "ilockedaggr.sum", SQLSTATE(HY002)
RUNTIME_OBJECT_MISSING);
goto error;
}
if (!is_bat_nil(*rid)) {
if ((r = BATdescriptor(*rid)) == NULL) {
- err = createException(MAL, "ilockedaggr.sum",
SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
+ err = createException(MAL, "ilockedaggr.sum",
SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
goto error;
}
}
@@ -3070,12 +3070,12 @@ LALGavg(Client cntxt, MalBlkPtr mb, MalS
}
if (b == NULL ||
- g == NULL ||
- (cid && c == NULL) ||
- (rem && r == NULL) ||
- ((*rid && !is_bat_nil(*rid)) && bn == NULL) ||
- (bn && cn == NULL) ||
- ((bn && rrem) && rn == NULL)) {
+ g == NULL ||
+ (cid && c == NULL) ||
+ (rem && r == NULL) ||
+ ((*rid && !is_bat_nil(*rid)) && bn == NULL) ||
+ (bn && cn == NULL) ||
+ ((bn && rrem) && rn == NULL)) {
err = createException(MAL, "ilockedaggr.avg", SQLSTATE(HY002)
RUNTIME_OBJECT_MISSING);
goto error;
}
@@ -3480,12 +3480,12 @@ LALGsum_float(Client cntxt, MalBlkPtr mb
}
if (b == NULL ||
- g == NULL ||
- (cid && c == NULL) ||
- (rem && r == NULL) ||
- ((*rid && !is_bat_nil(*rid)) && bn == NULL) ||
- (bn && cn == NULL) ||
- ((bn && rrem) && rn == NULL)) {
+ g == NULL ||
+ (cid && c == NULL) ||
+ (rem && r == NULL) ||
+ ((*rid && !is_bat_nil(*rid)) && bn == NULL) ||
+ (bn && cn == NULL) ||
+ ((bn && rrem) && rn == NULL)) {
err = createException(MAL, "ilockedaggr.sum", SQLSTATE(HY002)
RUNTIME_OBJECT_MISSING);
goto error;
}
@@ -3789,7 +3789,7 @@ bail:
BATiter ri = bat_iterator(r); \
char *bp = bi.vh->base; \
char *op = ri.vh->base; \
- int (*cmp)(const void *v1,const void *v2) =
ATOMcompare(tt); \
+ int (*cmp)(const void *v1,const void *v2) =
ATOMcompare(tt); \
const char *nil = ATOMnilptr(r->ttype); \
if (b->twidth == 1) { \
bp += GDK_VAROFFSET; \
@@ -3863,7 +3863,7 @@ getoffset(const void *b, BUN p, int w)
BATiter bi = bat_iterator(b); \
BATiter ri = bat_iterator(r); \
char *bp = bi.vh->base; \
- int (*cmp)(const void *v1,const void *v2) =
ATOMcompare(tt); \
+ int (*cmp)(const void *v1,const void *v2) =
ATOMcompare(tt); \
const char *nil = ATOMnilptr(r->ttype); \
if (b->twidth == 1) { \
bp += GDK_VAROFFSET; \
@@ -4437,8 +4437,8 @@ LALGcnull(Client ctx, bat *rid, bat *gid
if (tt == TYPE_##Type) { \
Type *in = Tloc(b, 0); \
Type *o = Tloc(r, 0); \
- BUN s = 0; \
- oid cur = grp[0]; \
+ BUN s = 0; \
+ oid cur = grp[0]; \
TIMEOUT_LOOP_IDX_DECL(i, cnt, qry_ctx) { \
if (grp[i] != cur) { \
BUN pos = ((i-s-1)*p/100); \
@@ -4900,26 +4900,26 @@ IALGfsum(Client ctx, dbl *result, dbl *c
#include "mel.h"
static mel_func pp_algebra_init_funcs[] = {
- command("igroup", "group", LALGgroup, false, "Group input.", args(2,3,
batarg("gid", oid), batargany("sink",1), batargany("b",1))),
+ command("igroup", "group", LALGgroup, false, "Group input.", args(2,3,
batarg("gid", oid), batargany("sink",1), batargany("b",1))),
command("igroup", "group", LALGderive, false, "Sub Group input.", args(2,5,
batarg("gid", oid), batargany("sink",1), batarg("pgid", oid),
batargany("phash", 2), batargany("b",1))),
- pattern("ialgebra", "project", LALGconstant, false, "Project a single
value", args(1,3, batargany("",1), batarg("gid", oid), argany("val",1))),
- command("ialgebra", "projection", LALGprojection, false, "Project.",
args(1,3, batargany("",1), batarg("gid", oid), batargany("b",1))),
+ pattern("ialgebra", "project", LALGconstant, false, "Project a single value",
args(1,3, batargany("",1), batarg("gid", oid), argany("val",1))),
+ command("ialgebra", "projection", LALGprojection, false, "Project.",
args(1,3, batargany("",1), batarg("gid", oid), batargany("b",1))),
/* COUNT DISTINCT: globle / grouped */
- command("ialgebra", "unique", LALGunique, false, "Unique rows.",
args(2,4, batarg("gid", oid), batargany("",1), batargany("b",1),
batarg("s",oid))),
+ command("ialgebra", "unique", LALGunique, false, "Unique rows.", args(2,4,
batarg("gid", oid), batargany("",1), batargany("b",1), batarg("s",oid))),
command("ialgebra", "unique", LALGgroup_unique, false, "Unique rows per
group.", args(2,5, batarg("ngid", oid), batargany("",1), batargany("b",1),
batarg("s",oid), batarg("gid",oid))),
/********** Grouped aggregates **********/
- command("ilockedaggr", "min", LALGmin, false, "Min per group.",
args(1,4, batargany("",1), batarg("gid", oid),
batargany("", 1), batarg("pid", oid))),
- command("ilockedaggr", "max", LALGmax, false, "Max per group.",
args(1,4, batargany("",1), batarg("gid", oid),
batargany("", 1), batarg("pid", oid))),
- pattern("ilockedaggr", "prod", LALGprod, false, "product per group.",
args(1,4, batargany("",1), batarg("gid", oid),
batargany("", 2), batarg("pid", oid))),
- command("ilockedaggr", "null", LALGnull, false, "has-null per group per
partition.", args(1,4, batarg("",bit), batarg("gid", oid),
batargany("", 1), batarg("pid", oid))),
- command("ilockedaggr", "cnull", LALGcnull, false, "has-null per group all
partition combined.", args(1,4, batarg("",bit), batarg("gid", oid), batarg("",
bit), batarg("pid", oid))),
- command("ilockedaggr", "count", LALGcount, false, "Count per group.",
args(1,5, batarg("",lng), batarg("gid", oid),
batargany("", 1), arg("nonil", bit), batarg("pid", oid))),
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]