Update of /cvsroot/monetdb/pathfinder/compiler/algebra/map
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14484/algebra/map
Modified Files:
intro_thetajoin.c map_ori_names.c map_unq_names.c
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: intro_thetajoin.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/map/intro_thetajoin.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- intro_thetajoin.c 10 Dec 2007 15:10:00 -0000 1.10
+++ intro_thetajoin.c 13 Dec 2007 13:08:15 -0000 1.11
@@ -491,6 +491,7 @@
case la_frag_union:
case la_fragment:
+ case la_frag_extract:
case la_empty_frag:
/* for the fragment information we do not need to introduce
column names as the thetajoin can never be moved along
@@ -543,6 +544,15 @@
case la_rec_base:
break;
+ case la_fun_call:
+ case la_fun_param:
+ case la_fun_frag_param:
+ /* FIXME: for now we assume that a theta-join
+ cannot be pushed through a function application */
+ LEFT_COLS(n) = att_NULL;
+ RIGHT_COLS(n) = att_NULL;
+ break;
+
case la_proxy:
case la_proxy_base:
break;
Index: map_ori_names.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/map/map_ori_names.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- map_ori_names.c 10 Dec 2007 15:10:00 -0000 1.23
+++ map_ori_names.c 13 Dec 2007 13:08:15 -0000 1.24
@@ -229,8 +229,8 @@
{
PFalg_schema_t schema;
schema.count = p->schema.count;
- schema.items = PFmalloc (schema.count *
- sizeof (PFalg_schema_t));
+ schema.items = PFmalloc (schema.count *
+ sizeof (PFalg_schema_t));
for (unsigned int i = 0; i < p->schema.count; i++)
schema.items[i] =
@@ -245,8 +245,8 @@
{
PFalg_schema_t schema;
schema.count = p->schema.count;
- schema.items = PFmalloc (schema.count *
- sizeof (PFalg_schema_t));
+ schema.items = PFmalloc (schema.count *
+ sizeof (PFalg_schema_t));
for (unsigned int i = 0; i < p->schema.count; i++)
schema.items[i] =
@@ -825,6 +825,10 @@
res = fragment (O(L(p)));
break;
+ case la_frag_extract:
+ res = frag_extract (O(L(p)), p->sem.col_ref.pos);
+ break;
+
case la_frag_union:
res = PFla_frag_union (O(L(p)), O(R(p)));
break;
@@ -955,8 +959,8 @@
{
PFalg_schema_t schema;
schema.count = p->schema.count;
- schema.items = PFmalloc (schema.count *
- sizeof (PFalg_schema_t));
+ schema.items = PFmalloc (schema.count *
+ sizeof (PFalg_schema_t));
for (unsigned int i = 0; i < p->schema.count; i++)
schema.items[i] =
@@ -967,6 +971,48 @@
res = rec_base (schema);
} break;
+ case la_fun_call:
+ {
+ PFalg_schema_t schema;
+ schema.count = p->schema.count;
+ schema.items = PFmalloc (schema.count *
+ sizeof (PFalg_schema_t));
+
+ for (unsigned int i = 0; i < p->schema.count; i++)
+ schema.items[i] =
+ (struct PFalg_schm_item_t)
+ { .name = ONAME(p, p->schema.items[i].name),
+ .type = p->schema.items[i].type };
+
+ res = fun_call (O(L(p)), O(R(p)),
+ schema,
+ p->sem.fun_call.kind,
+ p->sem.fun_call.qname,
+ p->sem.fun_call.ctx,
+ ONAME(L(p), p->sem.fun_call.iter),
+ p->sem.fun_call.occ_ind);
+ } break;
+
+ case la_fun_param:
+ {
+ PFalg_schema_t schema;
+ schema.count = p->schema.count;
+ schema.items = PFmalloc (schema.count *
+ sizeof (PFalg_schema_t));
+
+ for (unsigned int i = 0; i < p->schema.count; i++)
+ schema.items[i] =
+ (struct PFalg_schm_item_t)
+ { .name = ONAME(p, p->schema.items[i].name),
+ .type = p->schema.items[i].type };
+
+ res = fun_param (PROJ(LEFT, p), O(R(p)), schema);
+ } break;
+
+ case la_fun_frag_param:
+ res = fun_frag_param (O(L(p)), O(R(p)), p->sem.col_ref.pos);
+ break;
+
case la_proxy:
case la_proxy_base:
PFoops (OOPS_FATAL,
Index: map_unq_names.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/map/map_unq_names.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- map_unq_names.c 10 Dec 2007 15:10:00 -0000 1.22
+++ map_unq_names.c 13 Dec 2007 13:08:16 -0000 1.23
@@ -177,7 +177,6 @@
res = PFla_empty_tbl_ (schema);
} break;
-
case la_ref_tbl:
{
PFalg_schema_t schema;
@@ -198,8 +197,6 @@
p->sem.ref_tbl.keys);
} break;
-
-
case la_attach:
res = attach (U(L(p)),
UNAME(p, p->sem.attach.res),
@@ -738,6 +735,10 @@
res = fragment (U(L(p)));
break;
+ case la_frag_extract:
+ res = frag_extract (U(L(p)), p->sem.col_ref.pos);
+ break;
+
case la_frag_union:
res = PFla_frag_union (U(L(p)), U(R(p)));
break;
@@ -859,6 +860,48 @@
res = rec_base (schema);
} break;
+ case la_fun_call:
+ {
+ PFalg_schema_t schema;
+ schema.count = p->schema.count;
+ schema.items = PFmalloc (schema.count *
+ sizeof (PFalg_schema_t));
+
+ for (unsigned int i = 0; i < p->schema.count; i++)
+ schema.items[i] =
+ (struct PFalg_schm_item_t)
+ { .name = UNAME(p, p->schema.items[i].name),
+ .type = p->schema.items[i].type };
+
+ res = fun_call (U(L(p)), U(R(p)),
+ schema,
+ p->sem.fun_call.kind,
+ p->sem.fun_call.qname,
+ p->sem.fun_call.ctx,
+ UNAME(L(p), p->sem.fun_call.iter),
+ p->sem.fun_call.occ_ind);
+ } break;
+
+ case la_fun_param:
+ {
+ PFalg_schema_t schema;
+ schema.count = p->schema.count;
+ schema.items = PFmalloc (schema.count *
+ sizeof (PFalg_schema_t));
+
+ for (unsigned int i = 0; i < p->schema.count; i++)
+ schema.items[i] =
+ (struct PFalg_schm_item_t)
+ { .name = UNAME(p, p->schema.items[i].name),
+ .type = p->schema.items[i].type };
+
+ res = fun_param (U(L(p)), U(R(p)), schema);
+ } break;
+
+ case la_fun_frag_param:
+ res = fun_frag_param (U(L(p)), U(R(p)), p->sem.col_ref.pos);
+ break;
+
case la_proxy:
case la_proxy_base:
PFoops (OOPS_FATAL,
-------------------------------------------------------------------------
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