Update of /cvsroot/monetdb/pathfinder/compiler/algebra/map
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3865/compiler/algebra/map
Modified Files:
Tag: M5XQ
map_ori_names.c
Log Message:
propagated changes of Friday Jun 12 2009 - Monday Jun 15 2009
from the development trunk to the M5XQ branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/06/12 - tsheyar: compiler/algebra/map/map_ori_names.c,1.45
-- Replaced aggregate operators count, min, max, avg, sum, prod, seqty1,
and all in the algebra by a single aggregate operator ``aggr''
that can handle multiple aggregates. The aggregate entries
are of kind count, min, max, avg, sum, prod, seqty1, all, and dist.
-- Added new aggregate kind ``dist'' that allows to represent group by
columns that functionally depend on the partitioning criterion
in the result of the grouping aggregate.
-- Added rewrite that merges aggregates.
-- Added rewrite that removes superfluous aggregates.
-- Added rewrite that pushes a rank operator through an aggregate.
-- Extended the XML import to cope with the old
as well as the new representation of aggregates.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
U map_ori_names.c
Index: map_ori_names.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/map/map_ori_names.c,v
retrieving revision 1.43.2.1
retrieving revision 1.43.2.2
diff -u -d -r1.43.2.1 -r1.43.2.2
--- map_ori_names.c 7 May 2009 14:42:39 -0000 1.43.2.1
+++ map_ori_names.c 15 Jun 2009 12:44:30 -0000 1.43.2.2
@@ -494,23 +494,44 @@
case la_to:
res = binary_op (PFla_to, p, map);
break;
+
+ case la_aggr:
+ {
+ PFla_op_t *left;
+ PFalg_aggr_t *aggr = PFmalloc (p->sem.aggr.count *
+ sizeof (PFalg_aggr_t));
+ PFalg_col_t col;
+ unsigned int count = 0;
- case la_avg:
- case la_max:
- case la_min:
- case la_sum:
- case la_prod:
- res = aggr (p->kind, PROJ(LEFT, p),
- ONAME(p, p->sem.aggr.res),
- ONAME(p, p->sem.aggr.col),
- p->sem.aggr.part?ONAME(p, p->sem.aggr.part):col_NULL);
- break;
+ left = O(L(p));
- case la_count:
- res = count (PROJ(LEFT, p),
- ONAME(p, p->sem.aggr.res),
- p->sem.aggr.part?ONAME(p, p->sem.aggr.part):col_NULL);
- break;
+ for (unsigned int i = 0; i < left->schema.count; i++) {
+ col = left->schema.items[i].name;
+ for (unsigned int j = 0; j < p->sem.aggr.count; j++)
+ /* we may get multiple hits */
+ if (col == PFprop_ori_name_left (
+ p->prop,
+ p->sem.aggr.aggr[j].col)) {
+ aggr[count++] = PFalg_aggr (
+ p->sem.aggr.aggr[j].kind,
+ ONAME(p, p->sem.aggr.aggr[j].res),
+ col);
+ }
+ }
+ for (unsigned int j = 0; j < p->sem.aggr.count; j++)
+ if (p->sem.aggr.aggr[j].kind == alg_aggr_count)
+ aggr[count++] = PFalg_aggr (
+ p->sem.aggr.aggr[j].kind,
+ ONAME(p, p->sem.aggr.aggr[j].res),
+ col_NULL);
+
+ assert (count == p->sem.aggr.count);
+
+ res = aggr (left,
+ p->sem.aggr.part?ONAME(p, p->sem.aggr.part):col_NULL,
+ p->sem.aggr.count,
+ aggr);
+ } break;
case la_rownum:
case la_rowrank:
@@ -568,20 +589,6 @@
p->sem.type.ty);
break;
- case la_seqty1:
- res = seqty1 (PROJ(LEFT, p),
- ONAME(p, p->sem.aggr.res),
- ONAME(p, p->sem.aggr.col),
- p->sem.aggr.part?ONAME(p,
p->sem.aggr.part):col_NULL);
- break;
-
- case la_all:
- res = all (PROJ(LEFT, p),
- ONAME(p, p->sem.aggr.res),
- ONAME(p, p->sem.aggr.col),
- p->sem.aggr.part?ONAME(p, p->sem.aggr.part):col_NULL);
- break;
-
case la_step:
/* In case columns iter and item_in are identical columns
item_in and item_out cannot refer to the same original
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins