Update of /cvsroot/monetdb/pathfinder/compiler/algebra/map
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3894/compiler/algebra/map

Modified Files:
      Tag: M5XQ
        map_unq_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_unq_names.c,1.44
-- 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_unq_names.c
Index: map_unq_names.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/map/map_unq_names.c,v
retrieving revision 1.42.2.1
retrieving revision 1.42.2.2
diff -u -d -r1.42.2.1 -r1.42.2.2
--- map_unq_names.c     7 May 2009 14:42:43 -0000       1.42.2.1
+++ map_unq_names.c     15 Jun 2009 12:44:35 -0000      1.42.2.2
@@ -483,23 +483,23 @@
             res = binary_op (PFla_to, p, map);
             break;
 
-        case la_avg:
-        case la_max:
-        case la_min:
-        case la_sum:
-        case la_prod:
-            res = aggr (p->kind, U(L(p)),
-                        UNAME(p, p->sem.aggr.res),
-                        /* column col is stored only in child operator */
-                        UNAME(L(p), p->sem.aggr.col),
-                        p->sem.aggr.part?UNAME(p, p->sem.aggr.part):col_NULL);
-            break;
+        case la_aggr:
+        {
+            PFalg_aggr_t *aggr = PFmalloc (p->sem.aggr.count *
+                                           sizeof (PFalg_aggr_t));
 
-        case la_count:
-            res = count (U(L(p)),
-                         UNAME(p, p->sem.aggr.res),
-                         p->sem.aggr.part?UNAME(p, p->sem.aggr.part):col_NULL);
-            break;
+            for (unsigned int i = 0; i < p->sem.aggr.count; i++)
+                aggr[i] = PFalg_aggr (p->sem.aggr.aggr[i].kind,
+                                      UNAME(p, p->sem.aggr.aggr[i].res),
+                                      p->sem.aggr.aggr[i].col
+                                      ? UNAME(L(p), p->sem.aggr.aggr[i].col)
+                                      : col_NULL);
+
+            res = aggr (U(L(p)),
+                        p->sem.aggr.part?UNAME(p, p->sem.aggr.part):col_NULL,
+                        p->sem.aggr.count,
+                        aggr);
+        }   break;
 
         case la_rownum:
         case la_rowrank:
@@ -556,22 +556,6 @@
                         p->sem.type.ty);
             break;
 
-        case la_seqty1:
-            res = seqty1 (U(L(p)),
-                          UNAME(p, p->sem.aggr.res),
-                          /* column col is stored only in child operator */
-                          UNAME(L(p), p->sem.aggr.col),
-                          p->sem.aggr.part?UNAME(p, 
p->sem.aggr.part):col_NULL);
-            break;
-
-        case la_all:
-            res = all (U(L(p)),
-                       UNAME(p, p->sem.aggr.res),
-                       /* column col is stored only in child operator */
-                       UNAME(L(p), p->sem.aggr.col),
-                       p->sem.aggr.part?UNAME(p, p->sem.aggr.part):col_NULL);
-            break;
-
         case la_step:
             res = step (U(L(p)), U(R(p)),
                         p->sem.step.spec,


------------------------------------------------------------------------------
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

Reply via email to