Changeset: a4bdaff22793 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a4bdaff22793
Branch: cnting_sketches
Log Message:
Merge with pp_hashjoin branch.
diffs (truncated from 694 to 300 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -900,6 +900,8 @@ const char copy_fromRef[];
const char corrRef[];
const char countRef[];
const char count_no_nilRef[];
+void counter_next(Sink *s);
+void counter_wait(Sink *s, int nr, Pipeline *p);
int cpyConstant(MalBlkPtr mb, VarPtr vr);
str createException(enum malexception, const char *, _In_z_
_Printf_format_string_ const char *, ...) __attribute__((__malloc__))
__attribute__((__format__(__printf__, 3, 4)))
__attribute__((__returns_nonnull__));
str createMalException(MalBlkPtr, int, enum malexception, _In_z_
_Printf_format_string_ const char *, ...) __attribute__((__malloc__))
__attribute__((__format__(__printf__, 4, 5)))
__attribute__((__returns_nonnull__));
@@ -1538,8 +1540,8 @@ str flt_num2dec_sht(Client ctx, sht *res
void freeVariables(Client c, MalBlkPtr mb, MalStkPtr glb, int oldvtop);
str getBackendContext(Client cntxt, backend **be);
str getSQLContext(Client cntxt, MalBlkPtr mb, mvc **c, backend **b);
-u_int32_t get_le_uint32(unsigned char *c);
-u_int32_t get_uint32(unsigned char *c);
+uint32_t get_le_uint32(unsigned char *c);
+uint32_t get_uint32(unsigned char *c);
str hge_dec2_bte(Client ctx, bte *res, const int *s1, const hge *v);
str hge_dec2_dbl(Client ctx, dbl *res, const int *s1, const hge *v);
str hge_dec2_flt(Client ctx, flt *res, const int *s1, const hge *v);
@@ -1619,19 +1621,19 @@ pqc_file *pqc_copy(pqc_file *pq);
pqc_file *pqc_dup(pqc_file *pq);
int pqc_get_field(char *in, int *fieldid, int *type);
pqc_filemetadata *pqc_get_filemetadata(pqc_file *pq);
-int pqc_get_int32(char *in, u_int32_t *v);
-int pqc_get_int64(char *in, u_int64_t *v);
+int pqc_get_int32(char *in, uint32_t *v);
+int pqc_get_int64(char *in, uint64_t *v);
int pqc_get_list(char *in, int *size, int *type);
const pqc_schema_element *pqc_get_schema_elements(pqc_file *pq, int *nr);
int pqc_get_string(char *in, char **s, int *len);
-int pqc_get_zint32(char *in, u_int32_t *v);
-int pqc_get_zint64(char *in, u_int64_t *v);
-int64_t pqc_mark_chunk(pqc_reader_t *r, int nr_workers, int wnr, u_int64_t
nrows);
+int pqc_get_zint32(char *in, uint32_t *v);
+int pqc_get_zint64(char *in, uint64_t *v);
+int64_t pqc_mark_chunk(pqc_reader_t *r, int nr_workers, int wnr, uint64_t
nrows);
int pqc_open(pqc_file **pq, char *fn);
-int pqc_put_int32(char *in, u_int32_t v);
-int pqc_put_int64(char *in, u_int64_t v);
+int pqc_put_int32(char *in, uint32_t v);
+int pqc_put_int64(char *in, uint64_t v);
int64_t pqc_read(pqc_file *pq, int64_t offset, char *buffer, int nrbytes);
-int64_t pqc_read_chunk(pqc_reader_t *r, int wnr, void *d, void *vd, u_int64_t
nrows, int *ssize, int *dict);
+int64_t pqc_read_chunk(pqc_reader_t *r, int wnr, void *d, void *vd, uint64_t
nrows, int *ssize, int *dict);
int pqc_read_filemetadata(pqc_file *pq);
int pqc_read_schema(pqc_file *pq);
pqc_reader_t *pqc_reader(pqc_reader_t *p, pqc_file *pq, int nr_workers,
pqc_filemetadata *fmd, int colnr, int64_t nrows, const void *nil);
diff --git a/sql/backends/monet5/copy_convert.c
b/sql/backends/monet5/copy_convert.c
--- a/sql/backends/monet5/copy_convert.c
+++ b/sql/backends/monet5/copy_convert.c
@@ -355,7 +355,7 @@ COPYparse_string(Client cntxt, MalBlkPtr
offset = (int) nil_offset;
nils++;
ok = copy_report_error(&errors, (lng) i, -1,
"incorrectly encoded UTF-8");
- } else if (n > (size_t) colwidth) {
+ } else if (colwidth && n > (size_t) colwidth) {
ok = copy_report_error(&errors, (lng) i, -1,
"field too long, max length is %d", colwidth);
} else {
ok = GDK_SUCCEED;
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;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]