Update of /cvsroot/monetdb/pathfinder/compiler/algebra/prop
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4681/compiler/algebra/prop
Modified Files:
Tag: M5XQ
prop_set.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_set.c,1.32
-- 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_set.c
Index: prop_set.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_set.c,v
retrieving revision 1.30.2.1
retrieving revision 1.30.2.2
diff -u -d -r1.30.2.1 -r1.30.2.2
--- prop_set.c 7 May 2009 14:45:15 -0000 1.30.2.1
+++ prop_set.c 15 Jun 2009 12:46:51 -0000 1.30.2.2
@@ -99,10 +99,6 @@
break;
case la_pos_select:
- case la_avg:
- case la_sum:
- case la_prod:
- case la_count:
case la_rownum:
case la_rowid:
case la_twig:
@@ -155,13 +151,29 @@
break;
case la_distinct:
- case la_max:
- case la_min:
- case la_seqty1:
- case la_all:
l_set = true;
break;
+ case la_aggr:
+ l_set = true;
+ for (unsigned int i = 0; i < n->sem.aggr.count; i++)
+ switch (n->sem.aggr.aggr[i].kind) {
+ case alg_aggr_dist:
+ case alg_aggr_min:
+ case alg_aggr_max:
+ case alg_aggr_all:
+ break;
+
+ case alg_aggr_count:
+ case alg_aggr_avg:
+ case alg_aggr_sum:
+ case alg_aggr_seqty1:
+ case alg_aggr_prod:
+ l_set = false;
+ break;
+ }
+ break;
+
case la_step:
case la_guide_step:
l_set = false;
@@ -402,31 +414,48 @@
break;
case la_distinct:
- case la_max:
- case la_min:
- case la_seqty1:
- case la_all:
/* allow duplicates for the argument */
l_col = col_NULL;
l_set = true;
break;
- case la_avg:
- case la_sum:
- case la_prod:
- case la_count:
- /* Switch the set property from TRUE to MAYBE (TRUE+col)
- if there is a partition column col and keep the MAYBE
- information if it stores the same column name. */
- if (n->prop->set && n->sem.aggr.part) {
- if ((n->prop->set_col && n->prop->set_col == n->sem.aggr.part)
||
- !n->prop->set_col) {
- l_col = n->sem.aggr.part;
- l_set = true;
+ case la_aggr:
+ l_col = col_NULL;
+ l_set = true;
+
+ for (unsigned int i = 0; i < n->sem.aggr.count; i++) {
+ switch (n->sem.aggr.aggr[i].kind) {
+ case alg_aggr_dist:
+ case alg_aggr_min:
+ case alg_aggr_max:
+ case alg_aggr_all:
+ break;
+
+ case alg_aggr_count:
+ case alg_aggr_avg:
+ case alg_aggr_sum:
+ case alg_aggr_seqty1:
+ case alg_aggr_prod:
+ /* Switch the set property from TRUE to MAYBE
(TRUE+col)
+ if there is a partition column col and keep the
MAYBE
+ information if it stores the same column name. */
+ if (n->prop->set &&
+ n->sem.aggr.part &&
+ ((n->prop->set_col &&
+ n->prop->set_col == n->sem.aggr.part) ||
+ !n->prop->set_col)) {
+ l_col = n->sem.aggr.part;
+ }
+ else {
+ l_set = false;
+ }
+ break;
+ }
+ if (!l_set) {
+ l_col = col_NULL;
break;
}
}
- l_set = false;
break;
case la_rowid:
------------------------------------------------------------------------------
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