Changeset: aaa8dd3b591b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aaa8dd3b591b
Modified Files:
clients/Tests/exports.stable.out
monetdb5/extras/rapi/converters.c.h
monetdb5/extras/rapi/rapi.c
monetdb5/mal/mal_atom.c
monetdb5/mal/mal_builder.c
monetdb5/mal/mal_debugger.c
monetdb5/mal/mal_function.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_instruction.h
monetdb5/mal/mal_interpreter.c
monetdb5/mal/mal_listing.c
monetdb5/mal/mal_parser.c
monetdb5/mal/mal_profiler.c
monetdb5/mal/mal_resolve.c
monetdb5/mal/mal_type.c
monetdb5/mal/mal_type.h
monetdb5/modules/atoms/json.c
monetdb5/modules/kernel/batcolor.c
monetdb5/modules/mal/batcalc.c
monetdb5/modules/mal/bbp.c
monetdb5/modules/mal/inspect.c
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/manifold.c
monetdb5/modules/mal/remote.c
monetdb5/optimizer/opt_coercion.c
monetdb5/optimizer/opt_mergetable.c
monetdb5/optimizer/opt_mitosis.c
monetdb5/optimizer/opt_multiplex.c
monetdb5/optimizer/opt_projectionpath.c
monetdb5/optimizer/opt_pushselect.c
monetdb5/optimizer/opt_remap.c
sql/backends/monet5/UDF/pyapi/connection.c
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_orderidx.c
sql/backends/monet5/sql_rank.c
Branch: default
Log Message:
Internal renaming for BAT type macros
diffs (truncated from 1504 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
@@ -2096,6 +2096,7 @@ str generatorRef;
MALfcn getAddress(stream *out, str filename, str modnme, str fcnname, int
silent);
str getArgDefault(MalBlkPtr mb, InstrPtr p, int idx);
ptr getArgReference(MalStkPtr stk, InstrPtr pci, int k);
+int getAtomIndex(str nme, int len, int deftpe);
lng getBatSpace(BAT *b);
int getBitConstant(MalBlkPtr mb, bit val);
int getBlockBegin(MalBlkPtr mb, int pc);
@@ -2134,7 +2135,6 @@ BAT *getTrace(const char *ev);
str getTraceRef;
malType getType(MalBlkPtr mb, str nme);
str getTypeIdentifier(malType tpe);
-int getTypeIndex(str nme, int len, int deftpe);
str getTypeName(malType tpe);
lng getUserTime(void);
str getVarName(MalBlkPtr mb, int i);
@@ -2227,7 +2227,6 @@ str logger_create_wrap(logger *L, int *d
str logger_destroy_wrap(void *ret, logger *L);
str lookupRef;
str mal2str(MalBlkPtr mb, int first, int last);
-malType malAnyBatType(malType t1, malType t2);
int malAtomSize(int size, int align, char *name);
int malBootstrap(void);
str malCommandCall(MalStkPtr stk, InstrPtr pci);
@@ -2437,7 +2436,6 @@ void resizeMalBlk(MalBlkPtr mb, int maxs
int resolveType(int dsttype, int srctype);
str resultSetRef;
str reuseRef;
-malType reverseBatType(malType v);
str row_numberRef;
str rpcRef;
str rsColumnRef;
diff --git a/monetdb5/extras/rapi/converters.c.h
b/monetdb5/extras/rapi/converters.c.h
--- a/monetdb5/extras/rapi/converters.c.h
+++ b/monetdb5/extras/rapi/converters.c.h
@@ -62,7 +62,7 @@
static SEXP bat_to_sexp(BAT* b) {
SEXP varvalue = NULL;
// TODO: deal with SQL types (DECIMAL/DATE)
- switch (ATOMstorage(getColumnType(b->ttype))) {
+ switch (ATOMstorage(getBatType(b->ttype))) {
case TYPE_void: {
size_t i = 0;
varvalue = PROTECT(NEW_LOGICAL(BATcount(b)));
diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c
--- a/monetdb5/extras/rapi/rapi.c
+++ b/monetdb5/extras/rapi/rapi.c
@@ -410,7 +410,7 @@ str RAPIeval(Client cntxt, MalBlkPtr mb,
// collect the return values
for (i = 0; i < pci->retc; i++) {
SEXP ret_col = VECTOR_ELT(retval, i);
- int bat_type = getColumnType(getArgType(mb,pci,i));
+ int bat_type = getBatType(getArgType(mb,pci,i));
if (bat_type == TYPE_any || bat_type == TYPE_void) {
getArgType(mb,pci,i) = bat_type;
msg = createException(MAL, "rapi.eval",
diff --git a/monetdb5/mal/mal_atom.c b/monetdb5/mal/mal_atom.c
--- a/monetdb5/mal/mal_atom.c
+++ b/monetdb5/mal/mal_atom.c
@@ -39,7 +39,7 @@ int malAtomProperty(MalBlkPtr mb, InstrP
(void)mb; /* fool compilers */
assert(pci != 0);
name = getFunctionId(pci);
- tpe = getTypeIndex(getModuleId(pci), (int)strlen(getModuleId(pci)),
TYPE_any);
+ tpe = getAtomIndex(getModuleId(pci), (int)strlen(getModuleId(pci)),
TYPE_any);
if (tpe < 0 || tpe >= GDKatomcnt || tpe >= MAXATOMS)
return 0;
assert(pci->fcn != NULL);
diff --git a/monetdb5/mal/mal_builder.c b/monetdb5/mal/mal_builder.c
--- a/monetdb5/mal/mal_builder.c
+++ b/monetdb5/mal/mal_builder.c
@@ -536,7 +536,7 @@ pushNilType(MalBlkPtr mb, InstrPtr q, ch
if (q == NULL)
return NULL;
- idx= getTypeIndex(tpe, -1, TYPE_any);
+ idx= getAtomIndex(tpe, -1, TYPE_any);
if( idx < 0 || idx >= GDKatomcnt || idx >= MAXATOMS)
return NULL;
cst.vtype=TYPE_void;
@@ -606,7 +606,7 @@ pushEmptyBAT(MalBlkPtr mb, InstrPtr q, i
getFunctionId(q) = getName("new");
q = pushArgument(mb, q, newTypeVariable(mb,TYPE_void));
- q = pushArgument(mb, q, newTypeVariable(mb,getColumnType(tpe)));
+ q = pushArgument(mb, q, newTypeVariable(mb,getBatType(tpe)));
q = pushZero(mb,q,TYPE_lng);
return q;
}
diff --git a/monetdb5/mal/mal_debugger.c b/monetdb5/mal/mal_debugger.c
--- a/monetdb5/mal/mal_debugger.c
+++ b/monetdb5/mal/mal_debugger.c
@@ -1192,7 +1192,7 @@ printBATelm(stream *f, bat i, BUN cnt, B
b = BATdescriptor(i);
if (b) {
- tpe = getTypeName(newColumnType(b->ttype));
+ tpe = getTypeName(newBatType(b->ttype));
mnstr_printf(f, ":%s ", tpe);
GDKfree(tpe);
printBATproperties(f, b);
@@ -1261,7 +1261,7 @@ printStackElm(stream *f, MalBlkPtr mb, V
BAT *b = BBPquickdesc(i, TRUE);
if (b) {
- nme = getTypeName(newColumnType(b->ttype));
+ nme = getTypeName(newBatType(b->ttype));
mnstr_printf(f, " :%s rows="BUNFMT, nme, BATcount(b));
} else {
nme = getTypeName(n->type);
diff --git a/monetdb5/mal/mal_function.c b/monetdb5/mal/mal_function.c
--- a/monetdb5/mal/mal_function.c
+++ b/monetdb5/mal/mal_function.c
@@ -294,14 +294,14 @@ static void replaceTypeVar(MalBlkPtr mb,
if( isaBatType(x)){
int tail;
int tx;
- tail = getColumnType(x);
- tx = getColumnIndex(x);
+ tail = getBatType(x);
+ tx = getTypeIndex(x);
if(v && tx == v && tail == TYPE_any){
tx= 0;
tail = t;
}
- y= newBatType(TYPE_void,tail);
- setAnyColumnIndex(y,tx);
+ y= newBatType(tail);
+ setTypeIndex(y,tx);
setArgType(mb,p,i,y);
#ifdef DEBUG_MAL_FCN
{
@@ -312,7 +312,7 @@ static void replaceTypeVar(MalBlkPtr mb,
}
#endif
} else
- if(getColumnIndex(x) == v){
+ if(getTypeIndex(x) == v){
#ifdef DEBUG_MAL_FCN
char *xnme = getTypeName(x);
mnstr_printf(GDKout," replace x= %s
polymorphic\n",xnme);
@@ -323,7 +323,7 @@ static void replaceTypeVar(MalBlkPtr mb,
#ifdef DEBUG_MAL_FCN
else {
char *xnme = getTypeName(x);
- mnstr_printf(GDKout," non x= %s
%d\n",xnme,getColumnIndex(x));
+ mnstr_printf(GDKout," non x= %s
%d\n",xnme,getTypeIndex(x));
GDKfree(xnme);
}
#endif
@@ -406,10 +406,10 @@ cloneFunction(stream *out, Module scope,
if (v == TYPE_any)
replaceTypeVar(new->def, pp, v, t);
if (isaBatType(v)) {
- if (getColumnIndex(v))
- replaceTypeVar(new->def, pp,
getColumnIndex(v), getColumnType(t));
+ if (getTypeIndex(v))
+ replaceTypeVar(new->def, pp,
getTypeIndex(v), getBatType(t));
} else
- replaceTypeVar(new->def, pp, getColumnIndex(v),
t);
+ replaceTypeVar(new->def, pp, getTypeIndex(v),
t);
}
#ifdef DEBUG_MAL_FCN
else {
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -738,7 +738,7 @@ getType(MalBlkPtr mb, str nme)
i = findVariable(mb, nme);
if (i < 0)
- return getTypeIndex(nme, -1, TYPE_any);
+ return getAtomIndex(nme, -1, TYPE_any);
return getVarType(mb, i);
}
@@ -1573,7 +1573,7 @@ pushArgumentId(MalBlkPtr mb, InstrPtr p,
}
v = findVariable(mb, name);
if (v < 0) {
- if ((v = newVariable(mb, name, getTypeIndex(name, -1,
TYPE_any))) < 0) {
+ if ((v = newVariable(mb, name, getAtomIndex(name, -1,
TYPE_any))) < 0) {
freeInstruction(p);
return NULL;
}
@@ -1680,9 +1680,9 @@ setPolymorphic(InstrPtr p, int tpe, int
return;
if (isaBatType(tpe))
c1= TYPE_oid;
- if (getColumnIndex(tpe) > 0)
- c2 = getColumnIndex(tpe);
- else if (getColumnType(tpe) == TYPE_any)
+ if (getTypeIndex(tpe) > 0)
+ c2 = getTypeIndex(tpe);
+ else if (getBatType(tpe) == TYPE_any)
c2 = 1;
c1 = c1 > c2 ? c1 : c2;
if (c1 > 0 && c1 >= p->polymorphic)
diff --git a/monetdb5/mal/mal_instruction.h b/monetdb5/mal/mal_instruction.h
--- a/monetdb5/mal/mal_instruction.h
+++ b/monetdb5/mal/mal_instruction.h
@@ -51,7 +51,6 @@
#define isTmpVar(M,I) ((M)->var[I]->tmpindex)
#define getVarType(M,I) ((M)->var[I]->type)
#define getVarGDKType(M,I) getGDKType((M)->var[I]->type)
-#define getGDKType(T) ( T <= TYPE_str ? T : (T == TYPE_any ?
TYPE_void : findGDKtype(T)))
#define clrVarFixed(M,I) ((M)->var[I]->flags &= ~VAR_FIXTYPE)
#define setVarFixed(M,I) ((M)->var[I]->flags |= VAR_FIXTYPE)
@@ -110,6 +109,8 @@
#define getArgName(M,P,I) getVarName((M),(P)->argv[I])
#define getArgType(M,P,I) getVarType((M),(P)->argv[I])
#define getArgGDKType(M,P,I) getVarGDKType((M),(P)->argv[I])
+#define getGDKType(T) ( T <= TYPE_str ? T : (T == TYPE_any ?
TYPE_void : findGDKtype(T)))
+
mal_export InstrPtr newInstruction(MalBlkPtr mb, int kind);
mal_export InstrPtr copyInstruction(InstrPtr p);
diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c
--- a/monetdb5/mal/mal_interpreter.c
+++ b/monetdb5/mal/mal_interpreter.c
@@ -639,7 +639,7 @@ str runMALsequence(Client cntxt, MalBlkP
if (isaBatType(t)) {
bat bid =
stk->stk[a].val.bval;
BAT *_b =
BATdescriptor(bid);
- t = getColumnType(t);
+ t = getBatType(t);
assert(stk->stk[a].vtype == TYPE_bat);
assert(bid == 0 ||
bid ==
bat_nil ||
@@ -664,7 +664,7 @@ str runMALsequence(Client cntxt, MalBlkP
if (isaBatType(t)) {
bat bid = stk->stk[a].val.bval;
- t = getColumnType(t);
+ t = getBatType(t);
assert(stk->stk[a].vtype ==
TYPE_bat);
assert(bid == 0 ||
bid == bat_nil ||
diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c
--- a/monetdb5/mal/mal_listing.c
+++ b/monetdb5/mal/mal_listing.c
@@ -77,10 +77,10 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk,
strcat(buf+len,cv);
len += strlen(buf+len);
GDKfree(cv);
- showtype =getColumnType(getVarType(mb,varid)) >
TYPE_str ||
+ showtype =getBatType(getVarType(mb,varid)) > TYPE_str
||
((isVarUDFtype(mb,varid) ||
isVarTypedef(mb,varid)) && isVarConstant(mb,varid)) ||
isaBatType(getVarType(mb,varid));
} else{
- if ( !isaBatType(getVarType(mb,varid)) &&
getColumnType(getVarType(mb,varid)) > TYPE_str ){
+ if ( !isaBatType(getVarType(mb,varid)) &&
getBatType(getVarType(mb,varid)) > TYPE_str ){
closequote = 1;
strcat(buf+len,"\"");
len++;
diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -663,7 +663,7 @@ simpleTypeId(Client cntxt)
cntxt->yycur--; /* keep it */
return -1;
}
- tpe = getTypeIndex(CURRENT(cntxt), l, -1);
+ tpe = getAtomIndex(CURRENT(cntxt), l, -1);
if (tpe < 0) {
parseError(cntxt, "Type identifier expected\n");
cntxt->yycur -= l; /* keep it */
@@ -690,34 +690,9 @@ parseTypeId(Client cntxt, int defaultTyp
return TYPE_bat;
}
-/*
- if (currChar(cntxt) == ']') {
- i = newBatType(TYPE_void, tt);
- if (kt > 0)
- setAnyColumnIndex(i, kt);
- nextChar(cntxt); // skip ]
- skipSpace(cntxt);
- return i;
- }
- Backward compatibility parsing of :bat[:oid,:type]
- if( tt != TYPE_oid){
- parseError(cntxt, "':oid' expected\n");
- return i;
- }
- if (currChar(cntxt) != ',')
- parseError(cntxt, "',' expected\n");
- nextChar(cntxt); // skip ,
- skipSpace(cntxt);
- if (currChar(cntxt) == ':') {
- tt = simpleTypeId(cntxt);
- kt = typeAlias(cntxt, tt);
- } else
- tt = TYPE_any;
- */
-
- i = newBatType(TYPE_void, tt);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list