Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19571/compiler/algebra
Modified Files:
algebra.c builtins.c logical.c physical.c
Log Message:
* Changed the names of the new types that were introduced for the docmgm
functions. Now the types are:
- aat_docmgmt
- aat_path
- aat_docnm
- aat_colnm
Note that we used only 1 more bit for these types since we re-used
the types introduced for the update functions.
* Algebra and MIL implementation for the docmgm functions:
- pf:add-doc(str,str)
- pf:add-doc(str,str,str)
- pf:add-doc(str,str,int)
- pf:add-doc(str,str,str,int)
* Change the serialize operator to identify docmgm queries and produce
the correct MIL code for that
* MIL implementation for the docmgmt_tape
* Dummy implementation of the DocmgmTape proc in pathfinder.mx
For now it just prints the BAT parameters, but next commit will be
with the correct implementation.
Everything works great, but for one *very very* strange thing. Inside the 1to1
function, case alg_fun_pf_add_doc_str_int reaches until logical level and then
disappears! This case has 4 params but that must not be the problem since case
alg_fun_fn_replace_flag has also 4 params and works fine. I could use some
help/suggestions on this one, since I have no idea why this is happening.
could it be some strange elimination/optimization code?
Index: physical.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/physical.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- physical.c 18 Jan 2008 16:11:36 -0000 1.52
+++ physical.c 20 Jan 2008 22:35:03 -0000 1.53
@@ -1691,19 +1691,6 @@
res_type = n->schema.items[ix[0]].type;
break;
- case alg_fun_pf_add_doc:
- assert(refs.count == 2);
-
- /* make sure atts are of the correct type */
- assert(n->schema.items[ix[0]].type == aat_str);
- assert(n->schema.items[ix[1]].type == aat_str);
-
- /* the returning type of doc management functions
- * is aat_docmgmt bitwise OR the attribute types*/
- res_type = aat_docmgmt | aat_str | aat_str1;
-
- break;
-
case alg_fun_pf_add_doc_str:
assert(refs.count == 3);
@@ -1714,20 +1701,7 @@
/* the returning type of doc management functions
* is aat_docmgmt bitwise OR the attribute types*/
- res_type = aat_docmgmt | aat_str | aat_str1 | aat_str2;
- break;
-
- case alg_fun_pf_add_doc_int:
- assert(refs.count == 3);
-
- /* make sure atts are of the correct type */
- assert(n->schema.items[ix[0]].type == aat_str);
- assert(n->schema.items[ix[1]].type == aat_str);
- assert(n->schema.items[ix[2]].type == aat_int);
-
- /* the returning type of doc management functions
- * is aat_docmgmt bitwise OR the attribute types */
- res_type = aat_docmgmt | aat_str | aat_str1 | aat_int;
+ res_type = aat_docmgmt | aat_path | aat_docnm | aat_colnm;
break;
case alg_fun_pf_add_doc_str_int:
@@ -1741,7 +1715,7 @@
/* the returning type of doc management functions
* is aat_docmgmt bitwise OR the attribute types */
- res_type = aat_docmgmt | aat_str | aat_str1 | aat_str2 | aat_int;
+ res_type = aat_docmgmt | aat_path | aat_docnm | aat_colnm;
break;
case alg_fun_pf_del_doc:
@@ -1752,7 +1726,7 @@
/* the returning type of doc management functions
* is aat_docmgmt bitwise OR the attribute types */
- res_type = aat_docmgmt | aat_str1;
+ res_type = aat_docmgmt | aat_docnm;
break;
case alg_fun_upd_delete:
Index: algebra.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/algebra.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- algebra.c 18 Jan 2008 16:11:36 -0000 1.67
+++ algebra.c 20 Jan 2008 22:35:01 -0000 1.68
@@ -702,10 +702,10 @@
case aat_node1:
case aat_pnode1:
case aat_anode1:
- case aat_pre1: /* or aat_str2, which can be compared but there is */
- case aat_attr1: /* no way to distinguish it from aat_pre1 */
- case aat_pfrag1: /* or aat_str1, same as str2. */
- case aat_afrag1:
+ case aat_pre1: /* or aat_docnm */
+ case aat_attr1:
+ case aat_pfrag1: /* or aat_path */
+ case aat_afrag1: /* or aat_colnm */
break; /* error */
}
@@ -739,18 +739,10 @@
case aat_node1: return "node1";
case aat_anode1:return "attr1";
case aat_attr1: return "attrID1";
- case aat_afrag1:return "afrag1";
+ case aat_afrag1:return "afrag1/colnm";
case aat_pnode1:return "pnode1";
- case aat_pre1:
- if (type & aat_docmgmt)
- return "aat_str2";
- else
- return "pre1";
- case aat_pfrag1:
- if (type & aat_docmgmt)
- return "aat_str1";
- else
- return "pfrag1";
+ case aat_pre1: return "pre1/docnm";
+ case aat_pfrag1:return "pfrag1/path";
default:
if (type & aat_update)
return "update";
@@ -1038,10 +1030,9 @@
}
if (!PFty_disjoint (ty, PFty_docmgmt ())) {
alg_ty |= aat_docmgmt;
- alg_ty |= aat_str;
- alg_ty |= aat_str1;
- alg_ty |= aat_str2;
- alg_ty |= aat_int;
+ alg_ty |= aat_path;
+ alg_ty |= aat_docnm;
+ alg_ty |= aat_colnm;
}
return alg_ty;
}
@@ -1102,9 +1093,7 @@
case alg_fun_fn_qname: return "fn:QName";
case alg_fun_pf_fragment: return "#pf:fragment";
case alg_fun_pf_supernode: return "#pf:supernode";
- case alg_fun_pf_add_doc: return "pf:add-doc";
case alg_fun_pf_add_doc_str: return "pf:add-doc";
- case alg_fun_pf_add_doc_int: return "pf:add-doc";
case alg_fun_pf_add_doc_str_int: return "pf:add-doc";
case alg_fun_pf_del_doc: return "pf:del-doc";
case alg_fun_upd_rename: return "upd:rename";
Index: logical.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/logical.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- logical.c 18 Jan 2008 16:11:36 -0000 1.77
+++ logical.c 20 Jan 2008 22:35:03 -0000 1.78
@@ -1439,18 +1439,6 @@
res_type = n->schema.items[ix[0]].type;
break;
- case alg_fun_pf_add_doc:
- assert(refs.count == 2);
-
- /* make sure atts are of the correct type */
- assert(n->schema.items[ix[0]].type == aat_str);
- assert(n->schema.items[ix[1]].type == aat_str);
-
- /* the returning type of doc management functions
- * is aat_docmgmt bitwise OR the attribute types*/
- res_type = aat_docmgmt | aat_str | aat_str1;
- break;
-
case alg_fun_pf_add_doc_str:
assert(refs.count == 3);
@@ -1461,20 +1449,7 @@
/* the returning type of doc management functions
* is aat_docmgmt bitwise OR the attribute types*/
- res_type = aat_docmgmt | aat_str | aat_str1 | aat_str2;
- break;
-
- case alg_fun_pf_add_doc_int:
- assert(refs.count == 3);
-
- /* make sure atts are of the correct type */
- assert(n->schema.items[ix[0]].type == aat_str);
- assert(n->schema.items[ix[1]].type == aat_str);
- assert(n->schema.items[ix[2]].type == aat_int);
-
- /* the returning type of doc management functions
- * is aat_docmgmt bitwise OR the attribute types */
- res_type = aat_docmgmt | aat_str | aat_str1 | aat_int;
+ res_type = aat_docmgmt | aat_path | aat_docnm | aat_colnm;
break;
case alg_fun_pf_add_doc_str_int:
@@ -1488,7 +1463,7 @@
/* the returning type of doc management functions
* is aat_docmgmt bitwise OR the attribute types */
- res_type = aat_docmgmt | aat_str | aat_str1 | aat_str2 | aat_int;
+ res_type = aat_docmgmt | aat_path | aat_docnm | aat_colnm;
break;
case alg_fun_pf_del_doc:
@@ -1499,7 +1474,7 @@
/* the returning type of doc management functions
* is aat_docmgmt bitwise OR the attribute types */
- res_type = aat_docmgmt | aat_str1;
+ res_type = aat_docmgmt | aat_docnm;
break;
case alg_fun_upd_delete:
Index: builtins.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/builtins.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- builtins.c 18 Jan 2008 16:11:36 -0000 1.72
+++ builtins.c 20 Jan 2008 22:35:02 -0000 1.73
@@ -4577,18 +4577,26 @@
return (struct PFla_pair_t) {
.rel = project (fun_1to1 (
- eqjoin (args[0].rel,
+ eqjoin (
+ eqjoin (
+ args[0].rel,
+ project (args[1].rel,
+ proj (att_iter1, att_iter),
+ proj (att_item1, att_item)),
+ att_iter,
+ att_iter1),
project (args[1].rel,
- proj (att_iter1, att_iter),
- proj (att_item1, att_item)),
+ proj (att_iter2, att_iter),
+ proj (att_item2, att_item)),
att_iter,
- att_iter1),
- alg_fun_pf_add_doc,
+ att_iter2),
+ alg_fun_pf_add_doc_str,
att_res,
- attlist (att_item, att_item1)),
+ attlist (att_item, att_item1, att_item2)),
proj (att_iter, att_iter),
proj (att_pos, att_pos),
proj (att_item, att_res)),
+
.frag = args[0].frag };
}
@@ -4636,7 +4644,9 @@
(void) loop; (void) ordering;
return (struct PFla_pair_t) {
- .rel = project (fun_1to1 (
+ .rel = project (
+ fun_1to1 (
+ eqjoin (
eqjoin (
eqjoin (
args[0].rel,
@@ -4645,17 +4655,25 @@
proj (att_item1, att_item)),
att_iter,
att_iter1),
- project (args[2].rel,
+ project (args[1].rel,
proj (att_iter2, att_iter),
proj (att_item2, att_item)),
att_iter,
att_iter2),
- alg_fun_pf_add_doc_int,
+ project (args[2].rel,
+ proj (att_iter3, att_iter),
+ proj (att_item3, att_item)),
+ att_iter,
+ att_iter3),
+ alg_fun_pf_add_doc_str_int,
att_res,
- attlist (att_item, att_item1, att_item2)),
- proj (att_iter, att_iter),
- proj (att_pos, att_pos),
- proj (att_item, att_res)),
+ attlist (att_item,
+ att_item1,
+ att_item2,
+ att_item3)),
+ proj(att_iter, att_iter),
+ proj(att_pos, att_pos),
+ proj(att_item, att_item)),
.frag = args[0].frag };
}
@@ -4670,7 +4688,8 @@
(void) loop; (void) ordering;
return (struct PFla_pair_t) {
- .rel = project (fun_1to1 (
+ .rel = project (
+ fun_1to1 (
eqjoin (
eqjoin (
eqjoin (
@@ -4686,8 +4705,8 @@
att_iter,
att_iter2),
project (args[3].rel,
- proj (att_iter3, att_iter),
- proj (att_item3, att_item)),
+ proj (att_iter3, att_iter),
+ proj (att_item3, att_item)),
att_iter,
att_iter3),
alg_fun_pf_add_doc_str_int,
@@ -4695,7 +4714,10 @@
attlist (att_item,
att_item1,
att_item2,
- att_item3))),
+ att_item3)),
+ proj(att_iter, att_iter),
+ proj(att_pos, att_pos),
+ proj(att_item, att_item)),
.frag = args[0].frag };
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins