Changeset: 09f53fe6a4d5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=09f53fe6a4d5
Added Files:
monetdb5/modules/atoms/Tests/json08.mal
Modified Files:
monetdb5/modules/mal/manifold.c
Branch: default
Log Message:
Properties should be set
The json test shows the properties are not yet properly set.
diffs (86 lines):
diff --git a/monetdb5/modules/atoms/Tests/json08.mal
b/monetdb5/modules/atoms/Tests/json08.mal
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/atoms/Tests/json08.mal
@@ -0,0 +1,36 @@
+#validity tests
+j:= bat.new(:oid,:json);
+b:= json.new("{}");
+bat.append(j,b);
+b:= json.new("{\"f1\":1}");
+bat.append(j,b);
+b:= json.new("{\"f1\":1,\"f2\":2}");
+bat.append(j,b);
+b:= json.new("{\"f1\":1,\"f2\":2,\"f1\":3}");
+bat.append(j,b);
+b:= json.new("{\"f1\":{\"f12\":3},\"f2\":[2,3,4]}");
+bat.append(j,b);
+b:= json.new("[1,\"f2\", 2]");
+bat.append(j,b);
+
+f:bat[:oid,:json]:= mal.manifold("json","filter",j,"f1");
+io.print(f);
+f:bat[:oid,:json]:= mal.manifold("json","filter",j,"f1");
+io.print(f);
+f:bat[:oid,:json]:= mal.manifold("json","filter",j,"f2");
+io.print(f);
+f:bat[:oid,:json]:= mal.manifold("json","filter",j,"f1");
+io.print(f);
+f:bat[:oid,:json]:= mal.manifold("json","filter",j,"f1");
+io.print(f);
+f:bat[:oid,:json]:= mal.manifold("json","filter",j,"f12");
+io.print(f);
+io.printf("#next batch\n");
+f:bat[:oid,:json]:= mal.manifold("json","filter",j,0);
+io.print(f);
+f:bat[:oid,:json]:= mal.manifold("json","filter",j,1);
+io.print(f);
+f:bat[:oid,:json]:= mal.manifold("json","filter",j,2);
+io.print(f);
+f:bat[:oid,:json]:= mal.manifold("json","filter",j,3);
+io.print(f);
diff --git a/monetdb5/modules/mal/manifold.c b/monetdb5/modules/mal/manifold.c
--- a/monetdb5/modules/mal/manifold.c
+++ b/monetdb5/modules/mal/manifold.c
@@ -24,6 +24,7 @@
#include "manifold.h"
#include "mal_resolve.h"
#include "mal_builder.h"
+#define _DEBUG_MANIFOLD_
/* The default iterator over known scalar commands.
* It can be less efficient then the vector based implementations,
@@ -163,18 +164,14 @@ MANIFOLDtypecheck(Client cntxt, MalBlkPt
// Prepare the single result variable
tpe =getTailType(getArgType(mb,pci,0));
- if ( ATOMstorage(tpe) > TYPE_str){
- freeMalBlk(nmb);
- return NULL;
- }
k= getArg(q,0) = newTmpVariable(nmb, tpe);
setVarFixed(nmb,k);
setVarUDFtype(nmb,k);
// extract their argument type
for ( i = pci->retc+2; i < pci->argc; i++){
- tpe = ATOMstorage(getTailType(getArgType(mb,pci,i)));
- if (tpe > TYPE_str){
+ tpe = getTailType(getArgType(mb,pci,i));
+ if (ATOMstorage(tpe) > TYPE_str){
freeMalBlk(nmb);
return NULL;
}
@@ -280,6 +277,12 @@ MANIFOLDevaluate(Client cntxt, MalBlkPtr
// consolidate the properties
BATsetcount(mat[0].b,cnt);
+ mat[0].b->tkey= 0;
+ mat[0].b->tsorted =0;
+ mat[0].b->trevsorted = 0;
+ mat[0].b->hkey= 0;
+ mat[0].b->hsorted =0;
+ mat[0].b->hrevsorted = 0;
BATderiveProps(mat[0].b, TRUE);
BBPkeepref(*(int*) getArgReference(stk,pci,0)=mat[0].b->batCacheid);
wrapup:
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list