Changeset: 433cb0b7918e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=433cb0b7918e
Modified Files:
        monetdb5/modules/kernel/arrays.mal
        sql/backends/monet5/sql_gencode.c
Branch: arrays
Log Message:

MAL functiosn for subselection on non-dimensional columns + sbslect gets two 
inputs if previous command had two outputs


diffs (52 lines):

diff --git a/monetdb5/modules/kernel/arrays.mal 
b/monetdb5/modules/kernel/arrays.mal
--- a/monetdb5/modules/kernel/arrays.mal
+++ b/monetdb5/modules/kernel/arrays.mal
@@ -18,6 +18,11 @@ address ALGdimensionThetasubselect1;
 command algebra.thetasubselect(dim:ptr, dims:ptr, candDims:ptr, 
candBat:bat[:oid,:oid], val:any, op:str) (:ptr, :bat[:oid,:oid])
 address ALGdimensionThetasubselect2;
 
+#subselection in dimensions
+command algebra.subselect(vals:bat[:oid,:any], dims:ptr, low:any, high:any, 
li:bit, hi:bit, anti:bit) (:ptr, :bat[:oid,:oid])
+address ALGnonDimensionSubselect1;
+command algebra.subselect(vals:bat[:oid,:oid], dims:ptr, candDims:ptr, 
candBat:bat[:oid,:oid], low:any, high:any, li:bit, hi:bit, anti:bit) (:ptr, 
:bat[:oid, :oid])
+address ALGnonDimensionSubselect2;
 
 #command algebra.mbrsubselect(dims:ptr, dim:ptr, s:bat[:oid, :oid], 
c:bat[:oid, :oid]) :bat[:oid,:oid]
 #address ALGmbrsubselect;
@@ -33,6 +38,7 @@ address ALGdimensionThetasubselect2;
 #command algebra.subselect(dims:ptr, valsBat:bat[:oid,:any], candDims:ptr, 
candBat:bat[:oid,:oid], low:any, high:any, li:bit, hi:bit, anti:bit) (:ptr, 
:bat[:oid, :oid])
 #address ALGnonDimensionSubselect2;
 
+#Creates a BAT that contains all cells that satisfied a series of selections 
on dimensions
 command algebra.cellsProject(candDims:ptr, candBAT:bat[:oid,:oid]) 
:bat[:oid,:oid]
 address ALGproject;
  
diff --git a/sql/backends/monet5/sql_gencode.c 
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -1446,17 +1446,18 @@ static int
                                        case cmp_notequal: {
                                                q = newStmt2(mb, algebraRef, 
cmd);
 
-                       if(s->op1->type == st_dimension) { //selection over a 
dimension, two outputs
-                                                       snprintf(nme, 
SMALLBUFSIZ, "Y_%d", l);
-                               uval = findVariable(mb, nme);
+//NOT NEEDED                           if(s->op1->type == st_dimension) { 
//selection over a dimension, two outputs
+                                               //check if the first argument 
has two outputs (in such a case it is related to the array processing)
+                                               snprintf(nme, SMALLBUFSIZ, 
"Y_%d", l);
+                           uval = findVariable(mb, nme);
                                
-                                                       assert(uval >=0);
-
+                                               if(uval >=0) {
+                                                       //two outputs
                                                        setVarType(mb, 
getArg(q, 0), TYPE_ptr);
                                                        setVarUDFtype(mb, 
getArg(q, 0));
                                                        q = pushReturn(mb, q, 
newTmpVariable(mb, newBatType(TYPE_oid, TYPE_oid)));
-                                                       q = pushArgument(mb, q, 
l); //all the dimensions
-                                                       q = pushArgument(mb, q, 
uval); //the current dimension
+                                                       q = pushArgument(mb, q, 
l); //the dimension or the non-dimension
+                                                       q = pushArgument(mb, q, 
uval); //all the dimensions
 /*NOT NEEDED                                           } else if(s->op1->type 
== st_join && s->op1->op2->type == st_bat && isArray(s->op1->op2->op4.cval->t)) 
{ //seelctio over non-dimensional column of an array
                                                        setVarType(mb, 
getArg(q, 0), TYPE_ptr);
                                                        setVarUDFtype(mb, 
getArg(q, 0));
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to