Changeset: 24a8094782ff for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=24a8094782ff
Modified Files:
        monetdb5/extras/jaql/jaql.c
        monetdb5/extras/jaql/jaqltree.h
        monetdb5/extras/jaql/parser/jaql.y
        sql/backends/monet5/Makefile.ag
        sql/backends/monet5/datacell/50_datacell.mal
        sql/backends/monet5/datacell/Makefile.ag
        sql/backends/monet5/datacell/datacell.c
        sql/backends/monet5/datacell/datacell.mal
Branch: default
Log Message:

jaql: add support for IN predicate to parser


diffs (134 lines):

diff --git a/monetdb5/extras/jaql/jaql.c b/monetdb5/extras/jaql/jaql.c
--- a/monetdb5/extras/jaql/jaql.c
+++ b/monetdb5/extras/jaql/jaql.c
@@ -1394,6 +1394,9 @@ printtree(tree *t, int level, char op)
                                        case j_lequal:
                                                printf("<= ");
                                                break;
+                                       case j_in:
+                                               printf("IN ");
+                                               break;
                                        case j_plus:
                                                printf("+ ");
                                                break;
diff --git a/monetdb5/extras/jaql/jaqltree.h b/monetdb5/extras/jaql/jaqltree.h
--- a/monetdb5/extras/jaql/jaqltree.h
+++ b/monetdb5/extras/jaql/jaqltree.h
@@ -92,6 +92,7 @@ enum comptype {
        j_gequal,
        j_less,
        j_lequal,
+       j_in,
        j_not,
        j_or,
        j_and,
diff --git a/monetdb5/extras/jaql/parser/jaql.y 
b/monetdb5/extras/jaql/parser/jaql.y
--- a/monetdb5/extras/jaql/parser/jaql.y
+++ b/monetdb5/extras/jaql/parser/jaql.y
@@ -256,10 +256,10 @@ predicates: opt_not predicate  {$$ = mak
 
 predicate: opt_not variable
                       {$$ = make_pred(NULL, $1, make_pred($2, 
make_comp(j_equals), make_bool(1)));}
-                | opt_not variable comparison value
-                      {$$ = make_pred(NULL, $1, make_pred($2, $3, $4));}
                 | opt_not val_var_arith comparison value
                       {$$ = make_pred(NULL, $1, make_pred($2, $3, $4));}
+                | opt_not json_value IN json_value
+                      {$$ = make_pred(NULL, $1, make_pred($2, make_comp(j_in), 
$4));}
                 ;
 
 variable: ident                     {$$ = make_varname($1);}
diff --git a/sql/backends/monet5/Makefile.ag b/sql/backends/monet5/Makefile.ag
--- a/sql/backends/monet5/Makefile.ag
+++ b/sql/backends/monet5/Makefile.ag
@@ -50,6 +50,7 @@ lib__sql = {
                   ../../storage/restrict/librestrictstore \
                   ../../common/libsqlcommon \
                   HAVE_RAPTOR?../../../monetdb5/extras/rdf/librdf \
+                  ENABLE_DATACELL?./datacell/lib_datacell \
                   ../../../monetdb5/tools/libmonetdb5 \
                   ../../../gdk/libbat \
                   ../../../common/stream/libstream \
diff --git a/sql/backends/monet5/datacell/50_datacell.mal 
b/sql/backends/monet5/datacell/50_datacell.mal
--- a/sql/backends/monet5/datacell/50_datacell.mal
+++ b/sql/backends/monet5/datacell/50_datacell.mal
@@ -21,4 +21,3 @@ include datacell;
 include basket;
 include receptor;
 include emitter;
-
diff --git a/sql/backends/monet5/datacell/Makefile.ag 
b/sql/backends/monet5/datacell/Makefile.ag
--- a/sql/backends/monet5/datacell/Makefile.ag
+++ b/sql/backends/monet5/datacell/Makefile.ag
@@ -32,7 +32,7 @@ INCLUDES = .. \
        ../../../../gdk
 
 lib__datacell = {
-       MODULE
+       NOINST
        DIR = libdir/monetdb5
        SEP = _
        SOURCES = basket.c \
@@ -43,9 +43,6 @@ lib__datacell = {
                  opt_datacell.c \
                  datacell.c \
                  emitter.c 
-
-       LIBS = ../../../../monetdb5/tools/libmonetdb5 \
-               ../../../../gdk/libbat 
 }
 
 bin_actuator = {
diff --git a/sql/backends/monet5/datacell/datacell.c 
b/sql/backends/monet5/datacell/datacell.c
--- a/sql/backends/monet5/datacell/datacell.c
+++ b/sql/backends/monet5/datacell/datacell.c
@@ -87,15 +87,11 @@ DCprelude(Client cntxt, MalBlkPtr mb, Ma
        sql_func *f;
        sql_trans *tr;
 
-       if (msg) {
-               GDKfree(msg);
-               return MAL_SUCCEED;
-       }
+       if (msg)
+               return msg;
+
        assert(m != NULL);
 
-       fprintf(stdout, "# MonetDB/DataCell module loaded\n");
-       fflush(stdout); /* make merovingian see this *now* */
-
        s = mvc_bind_schema(m, schema_default);
        if (s == NULL)
                throw(SQL, "datacell.prelude", "Schema missing");
diff --git a/sql/backends/monet5/datacell/datacell.mal 
b/sql/backends/monet5/datacell/datacell.mal
--- a/sql/backends/monet5/datacell/datacell.mal
+++ b/sql/backends/monet5/datacell/datacell.mal
@@ -17,10 +17,6 @@
 
 module datacell;
 
-pattern prelude()
-address DCprelude
-comment "Convert the datacell schema to a stream processing infrastructure";
-
 pattern basket(tab:str):void
 address DCregister
 comment "Initialize a new basket based on a specific table definition in the 
datacell schema");
@@ -61,6 +57,10 @@ pattern query(name:str):void
 address DCquery
 comment "Add a new continuous query procedure.";
 
+pattern prelude()
+address DCprelude
+comment "Convert the datacell schema to a stream processing infrastructure";
+
 pattern pause()
 address DCpauseScheduler
 comment "(Re)start the petrinet scheduler.";
@@ -106,4 +106,4 @@ command errors()(nme:bat[:oid,:str],erro
 address BSKTtableerrors
 comment "Return a table the erroneous events";
 
-datacell.prelude();
+io.printf("# MonetDB/DataCell loaded\n");
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to