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

Modified Files:
      Tag: M5XQ
        prop_req_node.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/prop/prop_req_node.c,1.19
-- 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 prop_req_node.c
Index: prop_req_node.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_req_node.c,v
retrieving revision 1.17.2.1
retrieving revision 1.17.2.2
diff -u -d -r1.17.2.1 -r1.17.2.2
--- prop_req_node.c     7 May 2009 14:45:06 -0000       1.17.2.1
+++ prop_req_node.c     15 Jun 2009 12:46:41 -0000      1.17.2.2
@@ -469,17 +469,30 @@
             assert ((type_of (n, n->sem.unary.col) & aat_node) == 0);
             break;
 
-        case la_avg:
-        case la_max:
-        case la_min:
-        case la_sum:
-        case la_prod:
-        case la_count:
-        case la_seqty1:
-        case la_all:
-            /* the output cannot be of type node */
-            if (!n->sem.aggr.part) {
-                prop_infer_req_node_vals (L(n), NULL);
+        case la_aggr:
+            /* dist aggregates or the partition column can be of type node */
+            if (MAP_LIST(n) != NULL && PFarray_last (MAP_LIST(n)) > 0) {
+                PFarray_t *new_map = PFarray (sizeof (req_node_t),
+                                              PFarray_last (MAP_LIST(n)));
+
+                for (unsigned int i = 0; i < n->sem.aggr.count; i++) {
+                    map = find_map (MAP_LIST(n), n->sem.aggr.aggr[i].res);
+                    if (map) {
+                        req_node_t map_item = *map;
+                        map_item.col = n->sem.aggr.aggr[i].col;
+                        ADD(new_map, map_item);
+                    }
+                }
+                if (n->sem.aggr.part) {
+                    map = find_map (MAP_LIST(n), n->sem.aggr.part);
+                    if (map) {
+                        req_node_t map_item = *map;
+                        map_item.col = n->sem.aggr.part;
+                        ADD(new_map, map_item);
+                    }
+                }
+
+                prop_infer_req_node_vals (L(n), new_map);
                 return; /* only infer once */
             }
             break;


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