Changeset: 1e44f1516894 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1e44f1516894
Modified Files:
        monetdb5/modules/atoms/str.c
Branch: txtsim-imp
Log Message:

Init var and change code to allow strimps with anti.


diffs (80 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -5240,7 +5240,7 @@ STRcontainsselect(bat *ret, const bat *b
                        rlen = str_strlen(vr);                                  
                                        \
                        nl = 0;                                                 
                                                \
                        canditer_reset(&lci);                                   
                                        \
-                       if (with_strimps) { /* for now no strimps with anti */  
        \
+                       if (with_strimps) {                                     
                                        \
                                if(!(filtered_sl = STRMPfilter(l, sl, vr, 
anti)))               \
                                        sl = filtered_sl;                       
                                                \
                        }                                                       
                                                                \
@@ -5300,6 +5300,18 @@ STRcontainsselect(bat *ret, const bat *b
                        } else if (nl > 1) {                                    
                                        \
                                r1->trevsorted = false;                         
                                \
                        }                                                       
                                                                \
+                       if (with_strimps && anti) {                             
                                \
+                               BAT *rev;                                       
                                                        \
+                               if (original_sl) {                              
                                                \
+                                       rev = BATdiffcand(original_sl, r1);     
                        \
+                                       assert (BATintersectcand(original_sl, 
r1)->batCount == r1->batCount); \
+                                       assert (rev->batCount == 
original_sl->batCount - r1->batCount); \
+                               }                                               
                                                                \
+                               else                                            
                                                        \
+                                       rev = BATnegcands(l->batCount, r1);     
                        \
+                               BBPreclaim(r1);                                 
                                        \
+                               r1 = rev;                                       
                                                        \
+                       }                                                       
                                                                \
                }                                                               
                                                                \
        } while (0)
 
@@ -5309,21 +5321,21 @@ strjoin(BAT *r1, BAT *r2, BAT *l, BAT *r
 {
        struct canditer lci, rci;
        const char *lvals, *rvals, *lvars, *rvars, *vl, *vr;
-       int rskipped = 0, rlen = 0;                 /* whether we skipped 
values in r */
-       oid lbase, rbase, lo, ro, lastl = 0;        /* last value inserted into 
r1 */
+       int rskipped = 0, rlen = 0;
+       oid lbase, rbase, lo, ro, lastl = 0;
        BUN nl, newcap;
-       BAT *original_sl = sl, *filtered_sl;
+       BAT *original_sl = sl, *filtered_sl = NULL;
        bool with_strimps = false;
        char *msg = MAL_SUCCEED;
 
        size_t counter = 0;
        lng timeoffset = 0;
        QryCtx *qry_ctx = MT_thread_get_qry_ctx();
-       if (qry_ctx != NULL) {
-               timeoffset = (qry_ctx->starttime && qry_ctx->querytimeout) ? 
(qry_ctx->starttime + qry_ctx->querytimeout) : 0;
-       }
-
-       if (BAThasstrimps(l) && !anti) {
+       if (qry_ctx != NULL)
+               timeoffset = (qry_ctx->starttime && qry_ctx->querytimeout) ?
+                       (qry_ctx->starttime + qry_ctx->querytimeout) : 0;
+
+       if (BAThasstrimps(l)) {
                if (STRMPcreate(l, NULL) == GDK_SUCCEED)
                        with_strimps = true;
                /* else throw the GDK error and default to nested loop without 
filters */
@@ -5367,10 +5379,14 @@ strjoin(BAT *r1, BAT *r2, BAT *l, BAT *r
        if (r2)
                set_empty_bat_props(r2);
 
-       if (anti)
-               batstr_join_loop(str_cmp(vl, vr, rlen) == 0, str_strlen(vr), 
with_strimps);
-       else
-               batstr_join_loop(str_cmp(vl, vr, rlen) != 0, str_strlen(vr), 
with_strimps);
+       /* if (anti) */
+       /*      batstr_join_loop(str_cmp(vl, vr, rlen) == 0, str_strlen(vr), 
with_strimps); */
+       /* else */
+       /*      batstr_join_loop(str_cmp(vl, vr, rlen) != 0, str_strlen(vr), 
with_strimps); */
+
+       batstr_join_loop(anti && !with_strimps ?
+                                        str_cmp(vl, vr, rlen) == 0 : 
str_cmp(vl, vr, rlen) != 0,
+                                        str_strlen(vr), with_strimps);
 
        assert(!r2 || BATcount(r1) == BATcount(r2));
        BATsetcount(r1, BATcount(r1));
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to