Changeset: 39fb1c0b695b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=39fb1c0b695b
Modified Files:
monetdb5/modules/mal/Makefile.ag
monetdb5/modules/mal/tablet.h
monetdb5/modules/mal/tablet_sql.c
monetdb5/optimizer/Makefile.ag
monetdb5/optimizer/opt_joinpath.c
monetdb5/optimizer/opt_mapreduce.c
monetdb5/optimizer/opt_mitosis.c
monetdb5/optimizer/opt_prejoin.c
monetdb5/optimizer/opt_statistics.c
monetdb5/optimizer/opt_support.c
monetdb5/optimizer/optimizer.h
Branch: headless
Log Message:
M5 layer compiles again
against the latest gdk changes.
diffs (truncated from 397 to 300 lines):
diff --git a/monetdb5/modules/mal/Makefile.ag b/monetdb5/modules/mal/Makefile.ag
--- a/monetdb5/modules/mal/Makefile.ag
+++ b/monetdb5/modules/mal/Makefile.ag
@@ -48,13 +48,13 @@
# recycle.c \
# remote.c \
sabaoth.c \
- tablet.c \
+# tablet.c \
tablet_sql.c \
# tokenizer.c \
txtsim.c \
- trader.c \
+ trader.c
# xmlcolumn.c \
- zorder.c
+# zorder.c
}
headers_mal = {
@@ -72,8 +72,8 @@
trader.mal \
tokenizer.mal trader.mal \
txtsim.mal \
- xmlcolumn.mal \
- zorder.mal
+ xmlcolumn.mal
+# zorder.mal
}
EXTRA_DIST = prelude.mx histogram.mal histogram.h mal_init.mal manual.mal
manual.h recycle.mal recycle.h sabaoth.mal sabaoth.h trader.mal trader.h
tablet.h
diff --git a/monetdb5/modules/mal/tablet.h b/monetdb5/modules/mal/tablet.h
--- a/monetdb5/modules/mal/tablet.h
+++ b/monetdb5/modules/mal/tablet.h
@@ -57,10 +57,9 @@
char *type;
int adt; /* type index */
COL *c[SLICES]; /* set to NULL when scalar is meant */
- COLiter ci[SLICES];
Histogram histogram[SLICES];
COL *bin[BINS];
- BUN p;
+ oid p;
unsigned int tabs; /* field size in tab positions */
str lbrk, rbrk; /* column brackets */
str nullstr; /* null representation */
@@ -96,11 +95,11 @@
str rlbrk, rrbrk; /* row brackets */
str properties; /* of header to display */
str title, footer; /* alternatives */
- BUN offset;
- BUN nr; /* allocated space for table loads */
+ oid offset;
+ oid nr; /* allocated space for table loads */
size_t pageLimit;
size_t firstrow, lastrow; /* last window to print */
- BUN nr_attrs; /* attributes found sofar */
+ oid nr_attrs; /* attributes found sofar */
size_t max_attrs;
Column *format; /* remove later */
stream *fd;
@@ -118,23 +117,23 @@
} Tablet;
tablet_export COL *TABLETload(Tablet *as, char *datafile);
-tablet_export BUN TABLEToutput(COL *order, COL *seps, COL *bats, stream *s);
-tablet_export void TABLETdump(COL *names, COL *seps, COL *bats, char
*datafile, BUN nr);
+tablet_export oid TABLEToutput(COL *order, COL *seps, COL *bats, stream *s);
+tablet_export void TABLETdump(COL *names, COL *seps, COL *bats, char
*datafile, oid nr);
/* The low level routines are primarilly used by the SQL front-end.*/
-tablet_export int TABLETcreate_bats(Tablet * as, BUN est);
-tablet_export BUN TABLETassign_COL(Tablet * as, COL *bats);
-tablet_export BUN TABLETload_file(Tablet * as, bstream *b, stream *out);
-tablet_export BUN SQLload_file(Client cntxt, Tablet * as, bstream *b, stream
*out, char *csep, char *rsep, char quote, lng skip, lng maxrow);
+tablet_export int TABLETcreate_bats(Tablet * as, oid est);
+tablet_export oid TABLETassign_COL(Tablet * as, COL *bats);
+tablet_export oid TABLETload_file(Tablet * as, bstream *b, stream *out);
+tablet_export oid SQLload_file(Client cntxt, Tablet * as, bstream *b, stream
*out, char *csep, char *rsep, char quote, lng skip, lng maxrow);
tablet_export COL *TABLETcollect_bats(Tablet * as);
-tablet_export COL *TABLETcollect_parts(Tablet * as, BUN offset);
+tablet_export COL *TABLETcollect_parts(Tablet * as, oid offset);
tablet_export void TABLETdestroy_format(Tablet * as);
tablet_export int TABLEToutput_file(Tablet * as, COL *order, stream *s);
tablet_export ptr *TABLETstrFrStr(Column *c, char *s, char *e);
tablet_export ptr *TABLETadt_frStr(Column *c, int type, char *s, char *e, char
quote);
tablet_export int TABLETadt_toStr(void *extra, char **buf, int *len, int type,
ptr a);
-tablet_export int insert_line(Tablet * as, char *line, BUN col1, BUN col2 );
+tablet_export int insert_line(Tablet * as, char *line, oid col1, oid col2 );
tablet_export int output_file_dense(Tablet * as, stream *fd);
tablet_export int has_whitespace(char *sep);
diff --git a/monetdb5/modules/mal/tablet_sql.c
b/monetdb5/modules/mal/tablet_sql.c
--- a/monetdb5/modules/mal/tablet_sql.c
+++ b/monetdb5/modules/mal/tablet_sql.c
@@ -162,13 +162,13 @@
char *val;
val = *s ? GDKstrdup(s) : GDKstrdup("");
if ( *err == NULL){
- if (snprintf(buf, BUFSIZ, "value '%.*s%s' from line "
BUNFMT
+ if (snprintf(buf, BUFSIZ, "value '%.*s%s' from line "
OIDFMT
" field %d not inserted,
expecting type %s\n",
BUFSIZ - 200, val,
strlen(val) > (size_t) BUFSIZ
- 200 ? "..." : "",
COLcount(fmt->c[0])+1,
col, fmt->type) < 0)
- snprintf(buf, BUFSIZ, "value from line " BUNFMT
+ snprintf(buf, BUFSIZ, "value from line " OIDFMT
" field %d not inserted,
expecting type %s\n",
COLcount(fmt->c[0])+1,
col, fmt->type);
@@ -188,7 +188,7 @@
return ret;
bunins_failed:
if (*err == NULL) {
- snprintf(buf, BUFSIZ, "parsing error from line " BUNFMT
+ snprintf(buf, BUFSIZ, "parsing error from line " OIDFMT
" field %d not inserted\n",
COLcount(fmt->c[0])+1, col);
*err= GDKstrdup(buf);
@@ -248,7 +248,7 @@
static int
SQLload_file_line(READERtask *task, int idx)
{
- BUN i;
+ oid i;
char errmsg[BUFSIZ];
char ch = *task->csep;
char *line = task->fields[0][idx];
@@ -268,7 +268,7 @@
if (!line) {
str errline = SQLload_error(task,task->next);
snprintf(errmsg,BUFSIZ, "End of string (%c)
missing "
- "in \"%s\" at line " BUNFMT " field
"BUNFMT"\n", task->quote, (errline?errline:""), COLcount(as->format->c[0]) +
task->next +1, i);
+ "in \"%s\" at line " OIDFMT " field
"OIDFMT"\n", task->quote, (errline?errline:""), COLcount(as->format->c[0]) +
task->next +1, i);
if ( errline )
GDKerror(errmsg);
GDKfree(errline);
@@ -291,7 +291,7 @@
}
/* not enough fields */
if ( i < as->nr_attrs-1) {
- snprintf(errmsg,BUFSIZ, "missing separator '%s' line "
BUNFMT " expecting " BUNFMT" got " BUNFMT " fields\n",
+ snprintf(errmsg,BUFSIZ, "missing separator '%s' line "
OIDFMT " expecting " OIDFMT" got " OIDFMT " fields\n",
fmt->sep, COLcount(fmt->c[0]) + idx,
as->nr_attrs-1, i);
errors:
/* we save all errors detected */
@@ -448,14 +448,14 @@
MT_exit_thread(0);
}
-BUN
+oid
SQLload_file(Client cntxt, Tablet * as, bstream *b, stream *out, char *csep,
char *rsep, char quote, lng skip, lng maxrow)
{
char *s, *e, *end;
- BUN cnt = 0;
+ oid cnt = 0;
int res = 0; /* < 0: error, > 0: success, ==
0: continue processing */
int j;
- BUN i;
+ oid i;
size_t rseplen;
READERtask *task= (READERtask*) GDKzalloc(sizeof(READERtask));
READERtask ptask[16];
@@ -520,7 +520,7 @@
as->error = NULL;
/* there is no point in creating more threads than we have columns */
- if (as->nr_attrs < (BUN) threads)
+ if (as->nr_attrs < (oid) threads)
threads = (int) as->nr_attrs;
/* allocate enough space for pointers into the buffer pool. */
@@ -573,7 +573,7 @@
#ifdef MLOCK_TST
mlock( task->b->buf, task->b->size);
#endif
- while ( (task->b->pos < task->b->len || !task->b->eof) && cnt < (BUN)
maxrow && res == 0) {
+ while ( (task->b->pos < task->b->len || !task->b->eof) && cnt < (oid)
maxrow && res == 0) {
if(task->errbuf && task->errbuf[0] ) {
msg = catchKernelException(cntxt, msg);
@@ -617,7 +617,7 @@
separator). If this is too costly, we have to
rethink the matter. */
e = s;
- while (s < end && (maxrow < 0 || cnt < (BUN) maxrow) ) {
+ while (s < end && (maxrow < 0 || cnt < (oid) maxrow) ) {
char q=0;
/* tokenize the record completely
the format of the input should comply to
@@ -704,7 +704,7 @@
total += t1;
iototal += tio;
#ifdef _DEBUG_TABLET_
- mnstr_printf(GDKout,"fill the BATs %d "BUNFMT" cap "
BUNFMT"\n", task->next, cnt, COLcapacity(as->format[0].c[0]));
+ mnstr_printf(GDKout,"fill the BATs %d "OIDFMT" cap "
OIDFMT"\n", task->next, cnt, COLcapacity(as->format[0].c[0]));
#endif
t1 = GDKusec();
if ( task->next ){
@@ -758,7 +758,7 @@
MT_sema_down(&task->consumer, "tablet loader");
}
- if (task->b->pos < task->b->len && cnt < (BUN) maxrow && task->ateof) {
+ if (task->b->pos < task->b->len && cnt < (oid) maxrow && task->ateof) {
GDKerror("Incomplete record at end of file.\n");
/* indicate that we did read everything (even if we couldn't
deal with it */
@@ -767,9 +767,9 @@
}
if (GDKdebug & GRPalgorithms) {
- if (cnt < (BUN) maxrow && maxrow > 0)
+ if (cnt < (oid) maxrow && maxrow > 0)
/* providing a precise count is not always easy,
instead consider maxrow as an upper bound */
- mnstr_printf(GDKout,"#SQLload_file: read error, tuples
missing (after loading " BUNFMT " records)\n", COLcount(as->format[0].c[0]));
+ mnstr_printf(GDKout,"#SQLload_file: read error, tuples
missing (after loading " OIDFMT " records)\n", COLcount(as->format[0].c[0]));
mnstr_printf(GDKout,"# COPY reader time "LLFMT " line break "
LLFMT " io " LLFMT "\n", total, lio, iototal);
#ifdef _DEBUG_TABLET_
for( i=0; i< as->nr_attrs; i++)
@@ -799,7 +799,7 @@
MT_join_thread(task->tid);
#ifdef _DEBUG_TABLET_
- mnstr_printf(GDKout,"Found " BUNFMT" tuples\n",cnt);
+ mnstr_printf(GDKout,"Found " OIDFMT" tuples\n",cnt);
#endif
for( i=0; i< as->nr_attrs; i++)
GDKfree(task->fields[i]);
diff --git a/monetdb5/optimizer/Makefile.ag b/monetdb5/optimizer/Makefile.ag
--- a/monetdb5/optimizer/Makefile.ag
+++ b/monetdb5/optimizer/Makefile.ag
@@ -40,7 +40,7 @@
opt_dataflow.c \
opt_deadcode.c \
# opt_derivepath.c \
- opt_dictionary.c \
+# opt_dictionary.c \ need a rewrite
opt_emptySet.c \
opt_evaluate.c \
opt_factorize.c \
diff --git a/monetdb5/optimizer/opt_joinpath.c
b/monetdb5/optimizer/opt_joinpath.c
--- a/monetdb5/optimizer/opt_joinpath.c
+++ b/monetdb5/optimizer/opt_joinpath.c
@@ -372,10 +372,10 @@
BUN
ALGjoinCost(Client cntxt, COL *l, COL *r, int flag)
{
- BUN lc, rc;
- BUN cost=0;
+ oid lc, rc;
+ oid cost=0;
#if 0
- BUN lsize,rsize;
+ oid lsize,rsize;
COL *lsample, *rsample, *j;
#endif
@@ -472,7 +472,7 @@
cost /= 1;
OPTDEBUGjoinpath
- mnstr_printf(cntxt->fdout,"#batjoin cost ?"BUNFMT"\n",cost);
+ mnstr_printf(cntxt->fdout,"#batjoin cost ?"OIDFMT"\n",cost);
return cost;
}
/*
@@ -492,7 +492,7 @@
ALGjoinPathBody(Client cntxt, int top, BAT **joins, int flag)
{
BAT *b = NULL;
- BUN estimate, e;
+ oid estimate, e;
int i, j, k;
int *postpone= (int*) GDKzalloc(sizeof(int) *top);
int postponed=0;
diff --git a/monetdb5/optimizer/opt_mapreduce.c
b/monetdb5/optimizer/opt_mapreduce.c
--- a/monetdb5/optimizer/opt_mapreduce.c
+++ b/monetdb5/optimizer/opt_mapreduce.c
@@ -72,7 +72,7 @@
{
str msg;
COL *cloud;
- BUN p, q;
+ oid p, q;
COLiter bi;
char nodes[BUFSIZ];
char *n = nodes;
diff --git a/monetdb5/optimizer/opt_mitosis.c b/monetdb5/optimizer/opt_mitosis.c
--- a/monetdb5/optimizer/opt_mitosis.c
+++ b/monetdb5/optimizer/opt_mitosis.c
@@ -134,7 +134,7 @@
pieces = i;
else {
/* ensure that GDKnr_threads partitions fit into main memory */
- r = (BUN) (monet_memory / typewidth / threads);
+ r = (oid) (monet_memory / typewidth / threads);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list