Update of /cvsroot/monetdb/pathfinder/compiler/sql
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14484/sql

Modified Files:
        lalg2sql.brg 
Log Message:
-- Implemented generic function application facility (for the logical algebra).

   Generic functions can now be implemented in the logical algebra using
   the following 4 operators:

   o la_fun_call:
     The head of a function call whose left child is the loop relation and the
     right child a function parameter list. The operator is prepared for a set
     of different kinds (e.g., xrpc and tijah), stores the function name and a
     pointer to an arbitrary context (for XRPC this is a reference to the core
     apply node).

   o la_fun_param:
     An item of the function parameter list refering to an algebra expression
     (left child) and to the rest of the function parameter list (right child).
     Its schema stores the names of all input columns. The order of columns
     in the schema is important!

   o la_fun_frag_param:
     An item of the function parameter list refering to a fragment (left child)
     and to the rest of the function parameter list (right child). It has a
     further position argument that indicates to which column of the next
     la_fun_param operator in the right child the fragment information refers
     to. This operator is only used if a column contains node references.

   o la_frag_extract:
     If a function call returns nodes a frag_extract operator sits on top of
     the la_fun_call operator to fix the fragment information needed by our
     compilation scheme. Similar to the la_fun_frag_param operator it stores
     the schema position of the item column it refers to.



Index: lalg2sql.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/sql/lalg2sql.brg,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- lalg2sql.brg        11 Dec 2007 13:15:15 -0000      1.96
+++ lalg2sql.brg        13 Dec 2007 13:08:18 -0000      1.97
@@ -148,9 +148,12 @@
                                 schema: iter | pos | item */
 /* all operators below represent xml node fragments with no schema */
 %term fragment        = 71 /**< representation of a node fragment */
-%term frag_union      = 72 /**< special node type used to form an algebraic
+%term frag_extract    = 72 /**< representation of a reference to a node
+                                fragment (used in combination with function
+                                calls to address the resulting fragments) */
+%term frag_union      = 73 /**< special node type used to form an algebraic
                                 union of fragments */
-%term empty_frag      = 73 /**< representation of an empty fragment */
+%term empty_frag      = 74 /**< representation of an empty fragment */
 
 %term cond_err        = 80 /**< facility to trigger runtime errors */
 %term nil             = 81 /**< end of the list of parameters */
@@ -163,6 +166,10 @@
                                 in the recursion */
 %term rec_base        = 88 /**< base of the DAG describing the recursion */
 
+%term fun_call        = 90 /**< function application */
+%term fun_param       = 91 /**< function application parameter */
+%term fun_frag_param  = 92 /**< function application parameter */
+    
 %term proxy           = 96 /**< proxy operator that represents a group
                                 of operators */
 %term proxy_base      = 97 /**< completes the content of the proxy
@@ -1021,7 +1028,8 @@
                                     selectivity (gt (PRE(step), PRE(ctx)),
                                                  lit_dec (1)));
                     where_list_add (WHERELIST(p),
-                                    selectivity (gteq (add (PRE(ctx), 
SIZE(ctx)),
+                                    selectivity (gteq (add (PRE(ctx),
+                                                            SIZE(ctx)),
                                                        PRE(step)),
                                                  lit_dec (1)));
                 } else {
@@ -1029,7 +1037,8 @@
                                     selectivity (gt (PRE(step), PRE(ctx)),
                                                  lit_dec (0.01)));
                     where_list_add (WHERELIST(p),
-                                    selectivity (gteq (add (PRE(ctx), 
SIZE(ctx)),
+                                    selectivity (gteq (add (PRE(ctx),
+                                                            SIZE(ctx)),
                                                        PRE(step)),
                                                  lit_dec (0.01)));
                 }
@@ -1052,7 +1061,8 @@
                                     selectivity (gteq (PRE(step), PRE(ctx)),
                                                  lit_dec (1)));
                     where_list_add (WHERELIST(p),
-                                    selectivity (gteq (add (PRE(ctx), 
SIZE(ctx)),
+                                    selectivity (gteq (add (PRE(ctx),
+                                                            SIZE(ctx)),
                                                      PRE(step)),
                                                  lit_dec (1)));
                 } else {
@@ -1060,7 +1070,8 @@
                                     selectivity (gteq (PRE(step), PRE(ctx)),
                                                  lit_dec (0.01)));
                     where_list_add (WHERELIST(p),
-                                    selectivity (gteq (add (PRE(ctx), 
SIZE(ctx)),
+                                    selectivity (gteq (add (PRE(ctx),
+                                                            SIZE(ctx)),
                                                      PRE(step)),
                                                  lit_dec (0.01)));
                 }
@@ -2182,12 +2193,9 @@
             /* Check if there are already common-table expressions
                or we have a standalone query */
             if (sql_stmts)
-                /* sql_stmts = root (ser_info, with (sql_stmts, final_query)); 
*/
                 sql_stmts = root (nil (), with (sql_stmts, final_query));
-               else
-                /* sql_stmts = root (ser_info, final_query); */
+            else
                 sql_stmts = root (nil (), final_query);
-    
         }
         break;
 
@@ -3105,7 +3113,9 @@
                              ext_column_name (newalias, res_col));
 
                 /* prepare fromlist */
-                from_list_add (FROMLIST(p), table_name(newtable), alias 
(newalias));
+                from_list_add (FROMLIST(p),
+                               table_name(newtable),
+                               alias (newalias));
 
                 /* run over the possible types */
                 for (PFalg_simple_type_t t = 1; t; t <<= 1)


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to