Changeset: 2c8b20f52465 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2c8b20f52465
Modified Files:
        gdk/gdk_hash.c
        gdk/gdk_imprints.c
        gdk/gdk_join.c
Branch: imprints-join
Log Message:

fix bugs; generate results for simple join


diffs (69 lines):

diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -165,12 +165,29 @@ do {                                      \
                }                                               \
        } while (0)
 
-
+#define starthash_imps(TYPE)                                                   
\
+       do {                                                            \
+               TYPE *v = (TYPE *) BUNtloc(bi, 0);                      \
+               int bin;                                                        
\
+               Imprints *imprints = (VIEWtparent(b) ? 
BBPdescriptor(VIEWtparent(b)): b)->timprints;            \
+               const TYPE *restrict bins = (TYPE *) imprints->bins;            
        \
+               const int B = imprints->bits;                   \
+               for (; r < p; r++) {                                    \
+                       BUN c;                                                  
        \
+                       GETBIN_IMPS(bin, *(v + r), B);          \
+                       c = (BUN) hash_imps_##TYPE(h, v+r, bin);                
\
+                                                                       \
+                       if (HASHget(h, c) == HASHnil(h) && nslots-- == 0) \
+                               break; /* mask too full */              \
+                       HASHputlink(h, r, HASHget(h, c));               \
+                       HASHput(h, c, r);                               \
+               }                                                       \
+       } while (0)
 #define finishhash_imps(TYPE)                                  \
        do {                                                    \
                TYPE *v = (TYPE *) BUNtloc(bi, 0);              \
                int bin;                                                        
\
-               Imprints *imprints = b->timprints;              \
+               Imprints *imprints = (VIEWtparent(b) ? 
BBPdescriptor(VIEWtparent(b)): b)->timprints;            \
                const TYPE *restrict bins = (TYPE *) imprints->bins;            
        \
                const int B = imprints->bits;                   \
                for (; p < q; p++) {                                    \
@@ -672,7 +689,7 @@ BAThash_imps(BAT *b, BUN masksize)
                                starthash(flt);
                                break;
                        case TYPE_int:
-                               starthash(int);
+                               starthash_imps(int);
                                break;
                        case TYPE_dbl:
                                starthash(dbl);
diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c
--- a/gdk/gdk_imprints.c
+++ b/gdk/gdk_imprints.c
@@ -286,7 +286,8 @@ BATcheckimprints(BAT *b)
 
 gdk_return
 BATsubimprints(BAT *b, BAT *g) {
-        return IMPSinternal(b, g);
+        //return IMPSinternal(b, g);
+               return IMPSinternal(b, (VIEWtparent(g) ? 
BBPdescriptor(VIEWtparent(g)): g));
 }
 
 gdk_return
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2628,7 +2628,7 @@ do {                                      \
        do {                                                            \
                BUN hashnil = HASHnil(hsh);                             \
                int bin;                                                        
        \
-               Imprints *imprints = l->timprints;              \
+               Imprints *imprints = (VIEWtparent(l) ? 
BBPdescriptor(VIEWtparent(l)): l)->timprints;            \
                const TYPE *restrict bins = (TYPE *) imprints->bins;            
        \
                const int B = imprints->bits;                   \
                for (lo = lstart + l->hseqbase;                         \
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to