Changeset: e9605c0cdccb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e9605c0cdccb
Modified Files:
monetdb5/extras/rdf/rdfschema.c
Branch: rdf
Log Message:
Build mapping convertedOid->tokenizerOid
diffs (54 lines):
diff --git a/monetdb5/extras/rdf/rdfschema.c b/monetdb5/extras/rdf/rdfschema.c
--- a/monetdb5/extras/rdf/rdfschema.c
+++ b/monetdb5/extras/rdf/rdfschema.c
@@ -11231,7 +11231,10 @@ str buildTKNZRMappingBat(BAT *lmap, BAT
int ret;
int num = 0;
bat mapBatId;
- BAT *tmpmapBat = NULL, *pMapBat = NULL;
+ BAT *tmpmapBat = NULL, *pMapBat = NULL,
+ *tmplmapBat = NULL, *tmprmapBat = NULL,
+ *plmapBat = NULL, *prmapBat = NULL;
+
str bname = NULL, bnamelBat = NULL, bnamerBat = NULL;
bat *lstCommits = NULL;
@@ -11291,12 +11294,34 @@ str buildTKNZRMappingBat(BAT *lmap, BAT
throw(MAL, "tokenizer.open", OPERATION_FAILED);
BATmode(pMapBat, PERSISTENT);
-
- lstCommits = GDKmalloc(sizeof(bat) * 2);
+
+ /*Make persistent bats for mappingId_to_tokenizerId lmap->rmap */
+ tmplmapBat = BATcopy(rmap, rmap->htype, rmap->ttype, TRUE, TRANSIENT);
+ tmprmapBat = BATcopy(lmap, lmap->htype, lmap->ttype, TRUE, TRANSIENT);
+ RDFbisubsort(&tmplmapBat, &tmprmapBat);
+
+ plmapBat = BATcopy(tmplmapBat, tmplmapBat->htype, tmplmapBat->ttype,
TRUE, PERSISTENT);
+ prmapBat = BATcopy(tmprmapBat, tmprmapBat->htype, tmprmapBat->ttype,
TRUE, PERSISTENT);
+
+ if (BKCsetName(&ret, (int *) &(plmapBat->batCacheid), (str *)
&bnamelBat) != MAL_SUCCEED)
+ throw(MAL, "tokenizer.open", OPERATION_FAILED);
+
+ if (BKCsetPersistent(&ret, (int *) &(plmapBat->batCacheid)) !=
MAL_SUCCEED)
+ throw(MAL, "tokenizer.open", OPERATION_FAILED);
+
+ if (BKCsetName(&ret, (int *) &(prmapBat->batCacheid), (str *)
&bnamerBat) != MAL_SUCCEED)
+ throw(MAL, "tokenizer.open", OPERATION_FAILED);
+
+ if (BKCsetPersistent(&ret, (int *) &(prmapBat->batCacheid)) !=
MAL_SUCCEED)
+ throw(MAL, "tokenizer.open", OPERATION_FAILED);
+
+ lstCommits = GDKmalloc(sizeof(bat) * 4);
lstCommits[0] = 0;
lstCommits[1] = pMapBat->batCacheid;
-
- TMsubcommit_list(lstCommits,2);
+ lstCommits[2] = plmapBat->batCacheid;
+ lstCommits[3] = prmapBat->batCacheid;
+
+ TMsubcommit_list(lstCommits,4);
GDKfree(lstCommits);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list