Changeset: 6f868cf549ee for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6f868cf549ee
Modified Files:
        sql/backends/monet5/vaults/parquet/offset_string_read_chunk.h
        sql/backends/monet5/vaults/parquet/parquet.c
        sql/backends/monet5/vaults/parquet/pqc_dict_lookup.h
        sql/backends/monet5/vaults/parquet/pqc_dict_lookup_var.h
        sql/backends/monet5/vaults/parquet/pqc_reader.c
Branch: pp_hashjoin
Log Message:

More steps towards getting this to build on Windows.


diffs (truncated from 615 to 300 lines):

diff --git a/sql/backends/monet5/vaults/parquet/offset_string_read_chunk.h 
b/sql/backends/monet5/vaults/parquet/offset_string_read_chunk.h
--- a/sql/backends/monet5/vaults/parquet/offset_string_read_chunk.h
+++ b/sql/backends/monet5/vaults/parquet/offset_string_read_chunk.h
@@ -26,7 +26,7 @@ offset_string_read_chunk( pqc_reader_t *
                return nrows;
        }
        for (int64_t i=0; i<nrows; i++) {
-               unsigned int len = get_uint32((uchar*)data);
+               unsigned int len = get_uint32((uint8_t*)data);
 
                data += sizeof(int);
                memcpy(buf, data, len);
diff --git a/sql/backends/monet5/vaults/parquet/parquet.c 
b/sql/backends/monet5/vaults/parquet/parquet.c
--- a/sql/backends/monet5/vaults/parquet/parquet.c
+++ b/sql/backends/monet5/vaults/parquet/parquet.c
@@ -1242,7 +1242,7 @@ PARQUETmetadata(Client cntxt, MalBlkPtr 
                        // should be enough to hold all concatenated encodings 
strings
                        char encodings_str[200] = "";
                        if (column_chunk.num_encodings ) {
-                               uint32_t char_cnt = 0;
+                               size_t char_cnt = 0;
                                for (uint32_t k = 0; k < 
column_chunk.num_encodings && char_cnt < 200; k++) {
                                        char *next = 
str_encoding(column_chunk.encodings[k]);
                                        char_cnt += strlen(next);
diff --git a/sql/backends/monet5/vaults/parquet/pqc_dict_lookup.h 
b/sql/backends/monet5/vaults/parquet/pqc_dict_lookup.h
--- a/sql/backends/monet5/vaults/parquet/pqc_dict_lookup.h
+++ b/sql/backends/monet5/vaults/parquet/pqc_dict_lookup.h
@@ -11,7 +11,7 @@
 static int64_t
 pqc_dict_lookup( pqc_creader_t *cr, void *output, int64_t nrows, int pos)
 {
-       uchar *data = (uchar*)cr->data;
+       uint8_t *data = (uint8_t*)cr->data;
        int nr_bits = cr->nr_bits;
        int64_t i = 0;
        bool mul8 = ((8/nr_bits)*nr_bits == 8);
@@ -28,7 +28,7 @@ pqc_dict_lookup( pqc_creader_t *cr, void
 
                        if (mul8) {
                                for(; i < nrows && j < cr->remaining; j++, i++) 
{
-                                       uchar v = data[pos];
+                                       uint8_t v = data[pos];
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 8) {
@@ -42,13 +42,13 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                        pos += (sh)/8;
                        } else if (nr_bits < 8) {
                                for(; i < nrows && j < cr->remaining; j++, i++) 
{
-                                       uchar v = data[pos];
+                                       uint8_t v = data[pos];
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 8) {
                                                pos++;
                                                sh -= 8;
-                                               uchar v = data[pos];
+                                               uint8_t v = data[pos];
                                                idx |= (v << (nr_bits-sh))&mask;
                                        }
                                        assert(idx < cr->dict_num_values);
@@ -58,13 +58,13 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                        pos += (sh)/8;
                        } else if (nr_bits < 16) {
                                for(; i < nrows && j < cr->remaining; j++, i++) 
{
-                                       usht v = *(usht*)(data+pos);
+                                       uint16_t v = *(uint16_t*)(data+pos);
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 16) {
                                                pos+=2;
                                                sh -= 16;
-                                               usht v = *(usht*)(data+pos);
+                                               uint16_t v = 
*(uint16_t*)(data+pos);
                                                idx |= (v << (nr_bits-sh))&mask;
                                        }
                                        assert(idx < cr->dict_num_values);
@@ -74,13 +74,13 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                        pos += (sh)/8;
                        } else if (nr_bits < 32) {
                                for(; i < nrows && j < cr->remaining; j++, i++) 
{
-                                       uint v = *(uint*)(data+pos);
+                                       uint32_t v = *(uint32_t*)(data+pos);
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 32) {
                                                pos+=4;
                                                sh -= 32;
-                                               uint v = *(uint*)(data+pos);
+                                               uint32_t v = 
*(uint32_t*)(data+pos);
                                                idx |= (v << (nr_bits-sh))&mask;
                                        }
                                        assert(idx < cr->dict_num_values);
@@ -100,11 +100,11 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                        len>>=1;
                        /* only 2 bits for now */
                        int sh = 0;
-                       int64_t j = 0;
-                       int m = len*8;
+                       uint32_t j = 0;
+                       uint32_t m = len*8;
                        if (mul8) {
                                for (; i < nrows && j < m; j++, i++) {
-                                       uchar v = data[pos];
+                                       uint8_t v = data[pos];
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 8) {
@@ -123,13 +123,13 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                }
                        } else if (nr_bits < 8) {
                                for (; i < nrows && j < m; j++, i++) {
-                                       uchar v = data[pos];
+                                       uint8_t v = data[pos];
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 8) {
                                                pos++;
                                                sh -= 8;
-                                               uchar v = data[pos];
+                                               uint8_t v = data[pos];
                                                idx |= (v << (nr_bits-sh))&mask;
                                        }
                                        assert(idx < cr->dict_num_values);
@@ -144,13 +144,13 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                }
                        } else if (nr_bits < 16) {
                                for (; i < nrows && j < m; j++, i++) {
-                                       usht v = *(usht*)(data+pos);
+                                       uint16_t v = *(uint16_t*)(data+pos);
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 16) {
                                                pos+=2;
                                                sh -= 16;
-                                               usht v = *(usht*)(data+pos);
+                                               uint16_t v = 
*(uint16_t*)(data+pos);
                                                idx |= (v << (nr_bits-sh))&mask;
                                        }
                                        assert(idx < cr->dict_num_values);
@@ -164,16 +164,14 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                        pos+=(sh/8);
                                }
                        } else if (nr_bits < 32) {
-                               int64_t j = 0;
-                               int m = len*8;
                                for (; i < nrows && j < m; j++, i++) {
-                                       uint v = *(uint*)(data+pos);
+                                       uint32_t v = *(uint32_t*)(data+pos);
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 32) {
                                                pos+=4;
                                                sh -= 32;
-                                               uint v = *(uint*)(data+pos);
+                                               uint32_t v = 
*(uint32_t*)(data+pos);
                                                idx |= (v << (nr_bits-sh))&mask;
                                        }
                                        assert(idx < cr->dict_num_values);
@@ -189,7 +187,7 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                        }
                } else if (nr_bits <= 8) { /* rle */
                        len>>=1;
-                       uchar idx = data[pos++];
+                       uint8_t idx = data[pos++];
                        idx &= mask;
                        uint32_t j = 0;
                        for(; i < nrows && j < len; j++, i++)
@@ -201,7 +199,7 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                        }
                } else if (nr_bits <= 16) { /* rle */
                        len>>=1;
-                       usht idx = *(usht*)(data+pos);
+                       uint16_t idx = *(uint16_t*)(data+pos);
                        idx &= mask;
                        uint32_t j = 0;
                        pos += 2;
@@ -214,7 +212,7 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                        }
                } else if (nr_bits <= 24) { /* rle */
                        len>>=1;
-                       uint idx = *(uint*)(data+pos);
+                       uint32_t idx = *(uint32_t*)(data+pos);
                        idx &= mask;
                        uint32_t j = 0;
                        pos += 3;
diff --git a/sql/backends/monet5/vaults/parquet/pqc_dict_lookup_var.h 
b/sql/backends/monet5/vaults/parquet/pqc_dict_lookup_var.h
--- a/sql/backends/monet5/vaults/parquet/pqc_dict_lookup_var.h
+++ b/sql/backends/monet5/vaults/parquet/pqc_dict_lookup_var.h
@@ -11,7 +11,7 @@
 static int64_t
 pqc_dict_lookup( pqc_creader_t *cr, void *output, int64_t nrows, int pos, int 
*ssize)
 {
-       uchar *data = (uchar*)cr->data;
+       uint8_t *data = (uint8_t*)cr->data;
        int nr_bits = cr->nr_bits;
        int64_t i = 0;
        int *offsets = (int*)(cr->dict + cr->dict_num_values * sizeof(char*));
@@ -30,7 +30,7 @@ pqc_dict_lookup( pqc_creader_t *cr, void
 
                        if (mul8) {
                                for(; i < nrows && j < cr->remaining; j++, i++) 
{
-                                       uchar v = data[pos];
+                                       uint8_t v = data[pos];
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 8) {
@@ -44,13 +44,13 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                        pos += (sh)/8;
                        } else if (nr_bits < 8) {
                                for(; i < nrows && j < cr->remaining; j++, i++) 
{
-                                       uchar v = data[pos];
+                                       uint8_t v = data[pos];
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 8) {
                                                pos++;
                                                sh -= 8;
-                                               uchar v = data[pos];
+                                               uint8_t v = data[pos];
                                                idx |= (v << (nr_bits-sh))&mask;
                                        }
                                        assert(idx < cr->dict_num_values);
@@ -60,13 +60,13 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                        pos += (sh)/8;
                        } else if (nr_bits < 16) {
                                for(; i < nrows && j < cr->remaining; j++, i++) 
{
-                                       usht v = *(usht*)(data+pos);
+                                       uint16_t v = *(uint16_t*)(data+pos);
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 16) {
                                                pos+=2;
                                                sh -= 16;
-                                               usht v = *(usht*)(data+pos);
+                                               uint16_t v = 
*(uint16_t*)(data+pos);
                                                idx |= (v << (nr_bits-sh))&mask;
                                        }
                                        assert(idx < cr->dict_num_values);
@@ -76,13 +76,13 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                        pos += (sh)/8;
                        } else if (nr_bits < 32) {
                                for(; i < nrows && j < cr->remaining; j++, i++) 
{
-                                       uint v = *(uint*)(data+pos);
+                                       uint32_t v = *(uint32_t*)(data+pos);
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 32) {
                                                pos+=4;
                                                sh -= 32;
-                                               uint v = *(uint*)(data+pos);
+                                               uint32_t v = 
*(uint32_t*)(data+pos);
                                                idx |= (v << (nr_bits-sh))&mask;
                                        }
                                        assert(idx < cr->dict_num_values);
@@ -107,7 +107,7 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                        int m = len*8;
                        if (mul8) {
                                for (; i < nrows && j < m; j++, i++) {
-                                       uchar v = data[pos];
+                                       uint8_t v = data[pos];
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 8) {
@@ -126,13 +126,13 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                }
                        } else if (nr_bits < 8) {
                                for (; i < nrows && j < m; j++, i++) {
-                                       uchar v = data[pos];
+                                       uint8_t v = data[pos];
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 8) {
                                                pos++;
                                                sh -= 8;
-                                               uchar v = data[pos];
+                                               uint8_t v = data[pos];
                                                idx |= (v << (nr_bits-sh))&mask;
                                        }
                                        assert(idx < cr->dict_num_values);
@@ -147,13 +147,13 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                }
                        } else if (nr_bits < 16) {
                                for (; i < nrows && j < m; j++, i++) {
-                                       usht v = *(usht*)(data+pos);
+                                       uint16_t v = *(uint16_t*)(data+pos);
                                        uint32_t idx = (v >> sh)&mask;
                                        sh += nr_bits;
                                        if (sh >= 16) {
                                                pos+=2;
                                                sh -= 16;
-                                               usht v = *(usht*)(data+pos);
+                                               uint16_t v = 
*(uint16_t*)(data+pos);
                                                idx |= (v << (nr_bits-sh))&mask;
                                        }
                                        assert(idx < cr->dict_num_values);
@@ -170,13 +170,13 @@ pqc_dict_lookup( pqc_creader_t *cr, void
                                int64_t j = 0;
                                int m = len*8;
                                for (; i < nrows && j < m; j++, i++) {
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to