Update of /cvsroot/monetdb/pathfinder/compiler/xmlimport
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29987/xmlimport
Modified Files:
xml2lalg.c xml2lalg_converters.c
Log Message:
-- Re-organized our set of numbering operators. We have now 4 different
operators with consistent semantics that cope with sorting and numbering:
- la_rownum behaves exactly like SQLs ROW_NUMBER. It is used to generate
position values.
- la_rowrank behaves exactly like SQLs DENSE_RANK. It is used to generate
the group by semantics of our functional source language. Up til now
we only need the unpartitioned variant. (In MIL it is implemented
using the sort extend.)
- la_rank -- beside one exception -- behaves like la_rowrank. It is also
implemented in our SQL compilation with a DENSE_RANK operation. la_rank's
important difference to la_rowrank is that its resulting values are used
solely for ordering. No operation should ever look at the generated
values.
While this difference is uninteresting in the resulting code it
simplifies
the algebraic optimizer a lot. Instead of repeatedly inferring a property
that checks for column usage we can optimize based on the operator kind.
- la_rowid generates unrepeatable unique numbers (as 'ROW_NUMBER() OVER ()'
does in SQL or 'mark()' does in MIL). It is used to generate a new key
column for mapping joins.
In comparison to the old version we introduced a new operator la_rowrank,
changed the semantic of la_rank from ROW_NUMBER to DENSE_RANK, and renamed
the formular la_number operator into la_rowid.
To implement positions in our Core to Algebra translation consistently we
now use only la_rownum (to generate real position values),
la_rank (to represent intermediate position order), and constant values
(to represent unordered sequences).
-- Introduced new SQL operator DENSE_RANK.
-- Splitted up the physical pa_number operator into the 3 operators:
pa_mark, pa_rank, and pa_mark_grp. The first and the last operator correspond
to the respective MIL primitives. The result column of pa_rank is generated
by the extend column of a CTrefine operation.
-- Added check for environment variable PF_DEBUG_PRINT_FRAG to disable the
fragment printing in the AT&T dot output of the logical algebra.
Index: xml2lalg.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/xmlimport/xml2lalg.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- xml2lalg.c 7 Nov 2007 22:00:38 -0000 1.3
+++ xml2lalg.c 6 Dec 2007 08:42:44 -0000 1.4
@@ -42,10 +42,6 @@
#include "pathfinder.h"
#include <stdio.h>
-#ifdef HAVE_STDBOOL_H
- #include <stdbool.h>
-#endif
-
#include <string.h>
#include <assert.h>
#include <stdlib.h>
@@ -1230,6 +1226,28 @@
/******************************************************************************/
/******************************************************************************/
+ case la_rowrank :
+
+ {
+ /*
+ <content>
+ <column name="COLNAME" new="true"/>
+ (<column name="COLNAME" function="sort" position="[0..n]"
direction="DIRECTION" new="false"/>)+
+ </content>
+ */
+
+ newAlgNode = PFla_rowrank
+ (
+ CHILDNODE(0),
+ PFLA_ATT("/content/[EMAIL PROTECTED]'true']/@name"),
+ PFLA_ORDERING("/content/[EMAIL PROTECTED]'sort']")
+ );
+ }
+ break;
+
+/******************************************************************************/
+/******************************************************************************/
+
case la_rank :
{
@@ -1252,7 +1270,7 @@
/******************************************************************************/
/******************************************************************************/
- case la_number :
+ case la_rowid :
{
/*
@@ -1261,7 +1279,7 @@
</content>
*/
- newAlgNode = PFla_number
+ newAlgNode = PFla_rowid
(
CHILDNODE(0),
PFLA_ATT("/content/[EMAIL PROTECTED]'true']/@name")
Index: xml2lalg_converters.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/xmlimport/xml2lalg_converters.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- xml2lalg_converters.c 7 Nov 2007 22:00:38 -0000 1.3
+++ xml2lalg_converters.c 6 Dec 2007 08:42:44 -0000 1.4
@@ -251,13 +251,17 @@
{
return la_rownum;
}
+ else if (strcmp(s, "rowrank") == 0)
+ {
+ return la_rowrank;
+ }
else if (strcmp(s, "rank") == 0)
{
return la_rank;
}
- else if (strcmp(s, "number") == 0)
+ else if (strcmp(s, "rowid") == 0)
{
- return la_number;
+ return la_rowid;
}
else if (strcmp(s, "type") == 0)
{
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins