Changeset: 87f9c7266ea1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/87f9c7266ea1
Modified Files:
gdk/gdk_strimps.c
sql/test/strimps/Tests/persisted_strimp.py
Branch: strimps-updates
Log Message:
Fix persistence bug and test
diffs (52 lines):
diff --git a/gdk/gdk_strimps.c b/gdk/gdk_strimps.c
--- a/gdk/gdk_strimps.c
+++ b/gdk/gdk_strimps.c
@@ -282,7 +282,7 @@ STRMPchoosePairs(PairHistogramElem *hist
cp[i].pbytes[0] = (uint8_t)((hist[indices[i]].idx >> 8) & 0xFF);
cp[i].idx = hist[indices[i]].idx;
cp[i].psize = 2;
- cp[i].mask = ((uint64_t)0x1) << (STRIMP_PAIRS - 1 - i);
+ cp[i].mask = ((uint64_t)0x1) << i;
}
TRC_DEBUG(ACCELERATOR, LLFMT " usec\n", GDKusec() - t0);
@@ -470,9 +470,9 @@ BATcheckstrimps(BAT *b)
hp->masks = (strimp_masks_t
*)GDKzalloc(STRIMP_HISTSIZE*sizeof(strimp_masks_t));
if (hp->masks != NULL) {
/* init */
+ size_t offset = 0;
for (size_t idx = 0; idx <
STRIMP_PAIRS; idx++) {
- size_t offset = 0;
- strimp_masks_t mask =
((strimp_masks_t)0x1) << (STRIMP_PAIRS - 1 - idx);
+ strimp_masks_t mask =
((strimp_masks_t)0x1) << idx;
uint8_t pair_size =
hp->sizes_base[idx];
uint8_t *pair =
hp->pairs_base + offset;
@@ -591,6 +591,8 @@ STRMPfilter(BAT *b, BAT *s, const char *
qbmask = STRMPmakebitstring(q, strmps);
assert((qbmask & ((uint64_t)0x1 << (STRIMP_HEADER_SIZE - 1))) == 0);
+ TRC_DEBUG(ACCELERATOR, "strimp filtering with pattern %s bitmap:
0x%016lx",
+ q, qbmask);
bitstring_array = (uint64_t *)strmps->bitstrings_base;
rvals = Tloc(r, 0);
diff --git a/sql/test/strimps/Tests/persisted_strimp.py
b/sql/test/strimps/Tests/persisted_strimp.py
--- a/sql/test/strimps/Tests/persisted_strimp.py
+++ b/sql/test/strimps/Tests/persisted_strimp.py
@@ -36,6 +36,15 @@ with tempfile.TemporaryDirectory() as fa
mdb.execute("""COPY 15000 RECORDS INTO orders from
r'{}/sql/benchmarks/tpch/SF-0.01/orders.tbl' USING DELIMITERS
'|','\n','"';""".format(os.getenv('TSTSRCBASE'))).assertSucceeded()
mdb.execute("""COPY 15000 RECORDS INTO orders from
r'{}/sql/benchmarks/tpch/SF-0.01/orders.tbl' USING DELIMITERS
'|','\n','"';""".format(os.getenv('TSTSRCBASE'))).assertSucceeded()
mdb.execute("""COPY 15000 RECORDS INTO orders from
r'{}/sql/benchmarks/tpch/SF-0.01/orders.tbl' USING DELIMITERS
'|','\n','"';""".format(os.getenv('TSTSRCBASE'))).assertSucceeded()
+ s.communicate()
+
+ with process.server(mapiport='0', dbname='db1',
+ dbfarm=fdir,
+ stdin=process.PIPE,
+ stdout=process.PIPE,
+ stderr=process.PIPE) as s:
+ with SQLTestCase() as mdb:
+ mdb.connect(database='db1', port=s.dbport, username='monetdb',
password='monetdb')
# Create strimp
mdb.execute("ALTER TABLE orders SET READ ONLY;")
mdb.execute("CREATE IMPRINTS INDEX o_comment_strimp ON
orders(o_comment);")
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]