Changeset: 4b8cf66d8bce for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4b8cf66d8bce
Modified Files:
clients/mapiclient/tomograph.c
monetdb5/modules/kernel/algebra.c
monetdb5/modules/kernel/algebra.h
monetdb5/modules/kernel/algebra.mal
monetdb5/modules/mal/pcre.c
monetdb5/modules/mal/pcre.mal
monetdb5/optimizer/opt_candidates.c
monetdb5/optimizer/opt_costModel.c
monetdb5/optimizer/opt_generator.c
monetdb5/optimizer/opt_mergetable.c
monetdb5/optimizer/opt_prelude.c
monetdb5/optimizer/opt_prelude.h
monetdb5/optimizer/opt_profiler.c
monetdb5/optimizer/opt_pushselect.c
monetdb5/optimizer/opt_support.c
monetdb5/optimizer/opt_support.h
monetdb5/optimizer/opt_volcano.c
sql/backends/monet5/sql.h
sql/backends/monet5/sql.mal
sql/backends/monet5/sql_statement.c
Branch: default
Log Message:
Patch for the subselect
diffs (truncated from 846 to 300 lines):
diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -280,7 +280,7 @@ base_colors[NUM_COLORS] = {
/* 10355 */ { 0, 0, "language", "pass", 0 },
/* 5941 */ { 0, 0, "sql", "bind", 0 },
/* 5664 */ { 0, 0, "mat", "packIncrement", 0 },
-/* 4796 */ { 0, 0, "algebra", "subselect", 0 },
+/* 4796 */ { 0, 0, "algebra", "select", 0 },
/* 4789 */ { 0, 0, "algebra", "subjoin", 0 },
/* 2664 */ { 0, 0, "sql", "projectdelta", 0 },
/* 2112 */ { 0, 0, "batcalc", "!=", 0 },
@@ -304,7 +304,7 @@ base_colors[NUM_COLORS] = {
/* 209 */ { 0, 0, "batcalc", "hge", 0 },
/* 209 */ { 0, 0, "calc", "str", 0 },
/* 207 */ { 0, 0, "aggr", "sum", 0 },
-/* 200 */ { 0, 0, "algebra", "thetasubselect", 0 },
+/* 200 */ { 0, 0, "algebra", "thetaselect", 0 },
/* 200 */ { 0, 0, "algebra", "selectNotNil", 0 },
/* 197 */ { 0, 0, "aggr", "subcount", 0 },
/* 166 */ { 0, 0, "batcalc", "dbl", 0 },
@@ -325,7 +325,7 @@ base_colors[NUM_COLORS] = {
/* 66 */ { 0, 0, "pqueue", "utopn_max", 0 },
/* 66 */ { 0, 0, "algebra", "tdiff", 0 },
/* 53 */ { 0, 0, "calc", "int", 0 },
-/* 47 */ { 0, 0, "algebra", "likesubselect", 0 },
+/* 47 */ { 0, 0, "algebra", "likeselect", 0 },
/* 44 */ { 0, 0, "sql", "exportOperation", 0 },
/* 42 */ { 0, 0, "algebra", "subslice", 0 },
/* 36 */ { 0, 0, "pqueue", "utopn_min", 0 },
diff --git a/monetdb5/modules/kernel/algebra.c
b/monetdb5/modules/kernel/algebra.c
--- a/monetdb5/modules/kernel/algebra.c
+++ b/monetdb5/modules/kernel/algebra.c
@@ -228,7 +228,7 @@ ALGcard(lng *result, const bat *bid)
}
str
-ALGsubselect2(bat *result, const bat *bid, const bat *sid, const void *low,
const void *high, const bit *li, const bit *hi, const bit *anti)
+ALGselect2(bat *result, const bat *bid, const bat *sid, const void *low, const
void *high, const bit *li, const bit *hi, const bit *anti)
{
BAT *b, *s = NULL, *bn;
const void *nilptr;
@@ -236,14 +236,14 @@ ALGsubselect2(bat *result, const bat *bi
if ((*li != 0 && *li != 1) ||
(*hi != 0 && *hi != 1) ||
(*anti != 0 && *anti != 1)) {
- throw(MAL, "algebra.subselect", ILLEGAL_ARGUMENT);
+ throw(MAL, "algebra.select", ILLEGAL_ARGUMENT);
}
if ((b = BATdescriptor(*bid)) == NULL) {
- throw(MAL, "algebra.subselect", RUNTIME_OBJECT_MISSING);
+ throw(MAL, "algebra.select", RUNTIME_OBJECT_MISSING);
}
if (sid && *sid != bat_nil && (s = BATdescriptor(*sid)) == NULL) {
BBPunfix(b->batCacheid);
- throw(MAL, "algebra.subselect", RUNTIME_OBJECT_MISSING);
+ throw(MAL, "algebra.select", RUNTIME_OBJECT_MISSING);
}
derefStr(b, low);
derefStr(b, high);
@@ -259,29 +259,29 @@ ALGsubselect2(bat *result, const bat *bi
if (s)
BBPunfix(s->batCacheid);
if (bn == NULL)
- throw(MAL, "algebra.subselect", GDK_EXCEPTION);
+ throw(MAL, "algebra.select", GDK_EXCEPTION);
*result = bn->batCacheid;
BBPkeepref(bn->batCacheid);
return MAL_SUCCEED;
}
str
-ALGsubselect1(bat *result, const bat *bid, const void *low, const void *high,
const bit *li, const bit *hi, const bit *anti)
+ALGselect1(bat *result, const bat *bid, const void *low, const void *high,
const bit *li, const bit *hi, const bit *anti)
{
- return ALGsubselect2(result, bid, NULL, low, high, li, hi, anti);
+ return ALGselect2(result, bid, NULL, low, high, li, hi, anti);
}
str
-ALGthetasubselect2(bat *result, const bat *bid, const bat *sid, const void
*val, const char **op)
+ALGthetaselect2(bat *result, const bat *bid, const bat *sid, const void *val,
const char **op)
{
BAT *b, *s = NULL, *bn;
if ((b = BATdescriptor(*bid)) == NULL) {
- throw(MAL, "algebra.thetasubselect", RUNTIME_OBJECT_MISSING);
+ throw(MAL, "algebra.thetaselect", RUNTIME_OBJECT_MISSING);
}
if (sid && *sid != bat_nil && (s = BATdescriptor(*sid)) == NULL) {
BBPunfix(b->batCacheid);
- throw(MAL, "algebra.thetasubselect", RUNTIME_OBJECT_MISSING);
+ throw(MAL, "algebra.thetaselect", RUNTIME_OBJECT_MISSING);
}
derefStr(b, val);
bn = BATthetaselect(b, s, val, *op);
@@ -289,16 +289,16 @@ ALGthetasubselect2(bat *result, const ba
if (s)
BBPunfix(s->batCacheid);
if (bn == NULL)
- throw(MAL, "algebra.subselect", GDK_EXCEPTION);
+ throw(MAL, "algebra.select", GDK_EXCEPTION);
*result = bn->batCacheid;
BBPkeepref(bn->batCacheid);
return MAL_SUCCEED;
}
str
-ALGthetasubselect1(bat *result, const bat *bid, const void *val, const char
**op)
+ALGthetaselect1(bat *result, const bat *bid, const void *val, const char **op)
{
- return ALGthetasubselect2(result, bid, NULL, val, op);
+ return ALGthetaselect2(result, bid, NULL, val, op);
}
str
diff --git a/monetdb5/modules/kernel/algebra.h
b/monetdb5/modules/kernel/algebra.h
--- a/monetdb5/modules/kernel/algebra.h
+++ b/monetdb5/modules/kernel/algebra.h
@@ -22,10 +22,10 @@ mal_export str ALGminany(ptr result, con
mal_export str ALGmaxany(ptr result, const bat *bid);
mal_export str ALGgroupby(bat *res, const bat *gids, const bat *cnts);
mal_export str ALGcard(lng *result, const bat *bid);
-mal_export str ALGsubselect1(bat *result, const bat *bid, const void *low,
const void *high, const bit *li, const bit *hi, const bit *anti);
-mal_export str ALGsubselect2(bat *result, const bat *bid, const bat *sid,
const void *low, const void *high, const bit *li, const bit *hi, const bit
*anti);
-mal_export str ALGthetasubselect1(bat *result, const bat *bid, const void
*val, const char **op);
-mal_export str ALGthetasubselect2(bat *result, const bat *bid, const bat *sid,
const void *val, const char **op);
+mal_export str ALGselect1(bat *result, const bat *bid, const void *low, const
void *high, const bit *li, const bit *hi, const bit *anti);
+mal_export str ALGselect2(bat *result, const bat *bid, const bat *sid, const
void *low, const void *high, const bit *li, const bit *hi, const bit *anti);
+mal_export str ALGthetaselect1(bat *result, const bat *bid, const void *val,
const char **op);
+mal_export str ALGthetaselect2(bat *result, const bat *bid, const bat *sid,
const void *val, const char **op);
mal_export str ALGsubjoin(bat *r1, bat *r2, const bat *l, const bat *r, const
bat *sl, const bat *sr, const bit *nil_matches, const lng *estimate);
mal_export str ALGsubleftjoin(bat *r1, bat *r2, const bat *l, const bat *r,
const bat *sl, const bat *sr, const bit *nil_matches, const lng *estimate);
diff --git a/monetdb5/modules/kernel/algebra.mal
b/monetdb5/modules/kernel/algebra.mal
--- a/monetdb5/modules/kernel/algebra.mal
+++ b/monetdb5/modules/kernel/algebra.mal
@@ -37,8 +37,8 @@ address ALGexist
comment "Returns whether 'val' occurs in b.";
# The range selections are targeted at the tail of the BAT.
-command subselect(b:bat[:any_1], low:any_1, high:any_1, li:bit, hi:bit,
anti:bit) :bat[:oid]
-address ALGsubselect1
+command select(b:bat[:any_1], low:any_1, high:any_1, li:bit, hi:bit, anti:bit)
:bat[:oid]
+address ALGselect1
comment "Select all head values for which the tail value is in range.
Input is a dense-headed BAT, output is a dense-headed BAT with in
the tail the head value of the input BAT for which the tail value
@@ -52,8 +52,8 @@ comment "Select all head values for whic
Note that the output is suitable as second input for the other
version of this function.";
-command subselect(b:bat[:any_1], s:bat[:oid], low:any_1, high:any_1, li:bit,
hi:bit, anti:bit) :bat[:oid]
-address ALGsubselect2
+command select(b:bat[:any_1], s:bat[:oid], low:any_1, high:any_1, li:bit,
hi:bit, anti:bit) :bat[:oid]
+address ALGselect2
comment "Select all head values of the first input BAT for which the tail value
is in range and for which the head value occurs in the tail of the
second input BAT.
@@ -70,16 +70,16 @@ comment "Select all head values of the f
Note that the output is suitable as second input for this
function.";
-command thetasubselect(b:bat[:any_1], val:any_1, op:str) :bat[:oid]
-address ALGthetasubselect1
+command thetaselect(b:bat[:any_1], val:any_1, op:str) :bat[:oid]
+address ALGthetaselect1
comment "Select all head values for which the tail value obeys the relation
value OP VAL.
Input is a dense-headed BAT, output is a dense-headed BAT with in
the tail the head value of the input BAT for which the
relationship holds. The output BAT is sorted on the tail value.";
-command thetasubselect(b:bat[:any_1], s:bat[:oid], val:any_1, op:str)
:bat[:oid]
-address ALGthetasubselect2
+command thetaselect(b:bat[:any_1], s:bat[:oid], val:any_1, op:str) :bat[:oid]
+address ALGthetaselect2
comment "Select all head values of the first input BAT for which the tail value
obeys the relation value OP VAL and for which the head value occurs in
the tail of the second input BAT.
diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -66,11 +66,11 @@ mal_export str BATPCREilike2(bat *ret, c
mal_export str BATPCREnotilike(bat *ret, const bat *b, const str *pat, const
str *esc);
mal_export str BATPCREnotilike2(bat *ret, const bat *b, const str *pat);
-mal_export str PCRElikesubselect2(bat *ret, const bat *bid, const bat *sid,
const str *pat, const str *esc, const bit *caseignore, const bit *anti);
-mal_export str PCRElikesubselect1(bat *ret, const bat *bid, const bat *cid,
const str *pat, const str *esc, const bit *anti);
-mal_export str PCRElikesubselect3(bat *ret, const bat *bid, const bat *sid,
const str *pat, const str *esc, const bit *anti);
-mal_export str PCRElikesubselect4(bat *ret, const bat *bid, const bat *cid,
const str *pat, const bit *anti);
-mal_export str PCRElikesubselect5(bat *ret, const bat *bid, const bat *sid,
const str *pat, const bit *anti);
+mal_export str PCRElikeselect2(bat *ret, const bat *bid, const bat *sid, const
str *pat, const str *esc, const bit *caseignore, const bit *anti);
+mal_export str PCRElikeselect1(bat *ret, const bat *bid, const bat *cid, const
str *pat, const str *esc, const bit *anti);
+mal_export str PCRElikeselect3(bat *ret, const bat *bid, const bat *sid, const
str *pat, const str *esc, const bit *anti);
+mal_export str PCRElikeselect4(bat *ret, const bat *bid, const bat *cid, const
str *pat, const bit *anti);
+mal_export str PCRElikeselect5(bat *ret, const bat *bid, const bat *sid, const
str *pat, const bit *anti);
mal_export str LIKEsubjoin(bat *r1, bat *r2, const bat *lid, const bat *rid,
const str *esc, const bat *slid, const bat *srid, const bit *nil_matches, const
lng *estimate);
mal_export str LIKEsubjoin1(bat *r1, bat *r2, const bat *lid, const bat *rid,
const bat *slid, const bat *srid, const bit *nil_matches, const lng *estimate);
@@ -316,7 +316,7 @@ pcre_compile_wrap(pcre **res, const char
} while (0)
static str
-pcre_likesubselect(BAT **bnp, BAT *b, BAT *s, const char *pat, int caseignore,
int anti)
+pcre_likeselect(BAT **bnp, BAT *b, BAT *s, const char *pat, int caseignore,
int anti)
{
#ifdef HAVE_LIBPCRE
int options = PCRE_UTF8 | PCRE_MULTILINE;
@@ -348,18 +348,18 @@ pcre_likesubselect(BAT **bnp, BAT *b, BA
}
#ifdef HAVE_LIBPCRE
if ((re = pcre_compile(pat, options, &error, &errpos, NULL)) == NULL)
- throw(MAL, "pcre.likesubselect",
+ throw(MAL, "pcre.likeselect",
OPERATION_FAILED ": compilation of pattern \"%s\"
failed\n", pat);
pe = pcre_study(re, 0, &error);
if (error != NULL) {
my_pcre_free(re);
pcre_free_study(pe);
- throw(MAL, "pcre.likesubselect",
+ throw(MAL, "pcre.likeselect",
OPERATION_FAILED ": studying pattern \"%s\"
failed\n", pat);
}
#else
if ((errcode = regcomp(&re, pat, options)) != 0) {
- throw(MAL, "pcre.likesubselect",
+ throw(MAL, "pcre.likeselect",
OPERATION_FAILED ": compilation of pattern \"%s\"
failed\n", pat);
}
#endif
@@ -371,7 +371,7 @@ pcre_likesubselect(BAT **bnp, BAT *b, BA
#else
regfree(&re);
#endif
- throw(MAL, "pcre.likesubselect", MAL_MALLOC_FAIL);
+ throw(MAL, "pcre.likeselect", MAL_MALLOC_FAIL);
}
off = b->hseqbase;
@@ -455,11 +455,11 @@ pcre_likesubselect(BAT **bnp, BAT *b, BA
regfree(&re);
#endif
*bnp = NULL;
- throw(MAL, "pcre.likesubselect", OPERATION_FAILED);
+ throw(MAL, "pcre.likeselect", OPERATION_FAILED);
}
static str
-re_likesubselect(BAT **bnp, BAT *b, BAT *s, const char *pat, int caseignore,
int anti, int use_strcmp)
+re_likeselect(BAT **bnp, BAT *b, BAT *s, const char *pat, int caseignore, int
anti, int use_strcmp)
{
BATiter bi = bat_iterator(b);
BAT *bn;
@@ -474,14 +474,14 @@ re_likesubselect(BAT **bnp, BAT *b, BAT
bn = COLnew(0, TYPE_oid, s ? BATcount(s) : BATcount(b), TRANSIENT);
if (bn == NULL)
- throw(MAL, "pcre.likesubselect", MAL_MALLOC_FAIL);
+ throw(MAL, "pcre.likeselect", MAL_MALLOC_FAIL);
off = b->hseqbase;
if (!use_strcmp) {
nr = re_simple(pat);
re = re_create(pat, nr);
if (!re)
- throw(MAL, "pcre.likesubselect", MAL_MALLOC_FAIL);
+ throw(MAL, "pcre.likeselect", MAL_MALLOC_FAIL);
}
if (s && !BATtdense(s)) {
const oid *candlist;
@@ -591,7 +591,7 @@ re_likesubselect(BAT **bnp, BAT *b, BAT
re_destroy(re);
BBPreclaim(bn);
*bnp = NULL;
- throw(MAL, "pcre.likesubselect", OPERATION_FAILED);
+ throw(MAL, "pcre.likeselect", OPERATION_FAILED);
}
#define MAX_NR_CAPTURES 1024 /* Maximal number of captured substrings in one
original string */
@@ -1457,7 +1457,7 @@ BATPCREnotilike2(bat *ret, const bat *bi
}
str
-PCRElikesubselect2(bat *ret, const bat *bid, const bat *sid, const str *pat,
const str *esc, const bit *caseignore, const bit *anti)
+PCRElikeselect2(bat *ret, const bat *bid, const bat *sid, const str *pat,
const str *esc, const bit *caseignore, const bit *anti)
{
BAT *b, *s = NULL, *bn = NULL;
str res;
@@ -1494,7 +1494,7 @@ PCRElikesubselect2(bat *ret, const bat *
if (*caseignore) {
ppat = GDKmalloc(strlen(*pat) + 3);
if (ppat == NULL)
- throw(MAL, "algebra.likesubselect",
MAL_MALLOC_FAIL);
+ throw(MAL, "algebra.likeselect",
MAL_MALLOC_FAIL);
ppat[0] = '^';
strcpy(ppat + 1, *pat);
strcat(ppat, "$");
@@ -1503,7 +1503,7 @@ PCRElikesubselect2(bat *ret, const bat *
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list