Changeset: 780b5342ce75 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=780b5342ce75
Modified Files:
clients/Tests/MAL-signatures_all.stable.out.int128
clients/Tests/MAL-signatures_fits_geom.stable.out.int128
clients/Tests/MAL-signatures_geom.stable.out.int128
clients/Tests/MAL-signatures_none.stable.out.int128
clients/Tests/exports.stable.out
monetdb5/modules/atoms/00_json_hge.mal
monetdb5/modules/atoms/json.c
monetdb5/modules/atoms/json.h
Branch: default
Log Message:
json.filter(): fixed/extended changeset 9fa383fb0c33 for int128 (hge & hugeint)
diffs (130 lines):
diff --git a/clients/Tests/MAL-signatures_all.stable.out.int128
b/clients/Tests/MAL-signatures_all.stable.out.int128
--- a/clients/Tests/MAL-signatures_all.stable.out.int128
+++ b/clients/Tests/MAL-signatures_all.stable.out.int128
@@ -50234,9 +50234,9 @@ address IOttable;
comment Print an n-ary table. Like print, but does not print oid column
command iterator.filter(name:json,idx:hge,other:str):json
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_hge;
command iterator.filter(name:json,idx:hge):json
-address JSONfilterArray;
+address JSONfilterArray_hge;
command iterator.next(step:hge,last:hge):hge
address ITRnext_hge;
command iterator.next(step:dbl,last:dbl):dbl
diff --git a/clients/Tests/MAL-signatures_fits_geom.stable.out.int128
b/clients/Tests/MAL-signatures_fits_geom.stable.out.int128
--- a/clients/Tests/MAL-signatures_fits_geom.stable.out.int128
+++ b/clients/Tests/MAL-signatures_fits_geom.stable.out.int128
@@ -50150,9 +50150,9 @@ address IOttable;
comment Print an n-ary table. Like print, but does not print oid column
command iterator.filter(name:json,idx:hge,other:str):json
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_hge;
command iterator.filter(name:json,idx:hge):json
-address JSONfilterArray;
+address JSONfilterArray_hge;
command iterator.next(step:hge,last:hge):hge
address ITRnext_hge;
command iterator.next(step:dbl,last:dbl):dbl
diff --git a/clients/Tests/MAL-signatures_geom.stable.out.int128
b/clients/Tests/MAL-signatures_geom.stable.out.int128
--- a/clients/Tests/MAL-signatures_geom.stable.out.int128
+++ b/clients/Tests/MAL-signatures_geom.stable.out.int128
@@ -50126,9 +50126,9 @@ address IOttable;
comment Print an n-ary table. Like print, but does not print oid column
command iterator.filter(name:json,idx:hge,other:str):json
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_hge;
command iterator.filter(name:json,idx:hge):json
-address JSONfilterArray;
+address JSONfilterArray_hge;
command iterator.next(step:hge,last:hge):hge
address ITRnext_hge;
command iterator.next(step:dbl,last:dbl):dbl
diff --git a/clients/Tests/MAL-signatures_none.stable.out.int128
b/clients/Tests/MAL-signatures_none.stable.out.int128
--- a/clients/Tests/MAL-signatures_none.stable.out.int128
+++ b/clients/Tests/MAL-signatures_none.stable.out.int128
@@ -49954,9 +49954,9 @@ address IOttable;
comment Print an n-ary table. Like print, but does not print oid column
command iterator.filter(name:json,idx:hge,other:str):json
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_hge;
command iterator.filter(name:json,idx:hge):json
-address JSONfilterArray;
+address JSONfilterArray_hge;
command iterator.next(step:hge,last:hge):hge
address ITRnext_hge;
command iterator.next(step:dbl,last:dbl):dbl
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
@@ -1391,10 +1391,12 @@ str ITRnext_sht(sht *i, sht *step, sht *
str JSONdump(int *ret, json *val);
str JSONfilter(json *ret, json *js, str *expr);
str JSONfilterArrayDefault_bte(json *ret, json *j, bte *index, str *other);
+str JSONfilterArrayDefault_hge(json *ret, json *j, hge *index, str *other);
str JSONfilterArrayDefault_int(json *ret, json *j, int *index, str *other);
str JSONfilterArrayDefault_lng(json *ret, json *j, lng *index, str *other);
str JSONfilterArrayDefault_sht(json *ret, json *j, sht *index, str *other);
str JSONfilterArray_bte(json *ret, json *j, bte *index);
+str JSONfilterArray_hge(json *ret, json *j, hge *index);
str JSONfilterArray_int(json *ret, json *j, int *index);
str JSONfilterArray_lng(json *ret, json *j, lng *index);
str JSONfilterArray_sht(json *ret, json *j, sht *index);
diff --git a/monetdb5/modules/atoms/00_json_hge.mal
b/monetdb5/modules/atoms/00_json_hge.mal
--- a/monetdb5/modules/atoms/00_json_hge.mal
+++ b/monetdb5/modules/atoms/00_json_hge.mal
@@ -16,6 +16,6 @@
# All Rights Reserved.
command filter(name:json, idx:hge) :json
-address JSONfilterArray;
+address JSONfilterArray_hge;
command filter(name:json, idx:hge, other:str) :json
-address JSONfilterArrayDefault;
+address JSONfilterArrayDefault_hge;
diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -941,6 +941,24 @@ JSONfilterArrayDefault_lng(json *ret, js
return JSONfilterArrayDefault(ret, js, (lng) *index, *other);
}
+#ifdef HAVE_HGE
+str
+JSONfilterArray_hge(json *ret, json *js, hge *index)
+{
+ if (*index < (hge) GDK_lng_min || *index > (hge) GDK_lng_max)
+ throw(MAL, "json.filter", "index out of range");
+ return JSONfilterArrayDefault(ret, js, (lng) *index, 0);
+}
+
+str
+JSONfilterArrayDefault_hge(json *ret, json *js, hge *index, str *other)
+{
+ if (*index < (hge) GDK_lng_min || *index > (hge) GDK_lng_max)
+ throw(MAL, "json.filter", "index out of range");
+ return JSONfilterArrayDefault(ret, js, (lng) *index, *other);
+}
+#endif
+
str
JSONfilter(json *ret, json *js, str *expr)
{
diff --git a/monetdb5/modules/atoms/json.h b/monetdb5/modules/atoms/json.h
--- a/monetdb5/modules/atoms/json.h
+++ b/monetdb5/modules/atoms/json.h
@@ -87,6 +87,10 @@ json_export str JSONfilterArray_int(json
json_export str JSONfilterArrayDefault_int(json *ret, json *j, int *index, str
*other);
json_export str JSONfilterArray_lng(json *ret, json *j, lng *index);
json_export str JSONfilterArrayDefault_lng(json *ret, json *j, lng *index, str
*other);
+#ifdef HAVE_HGE
+json_export str JSONfilterArray_hge(json *ret, json *j, hge *index);
+json_export str JSONfilterArrayDefault_hge(json *ret, json *j, hge *index, str
*other);
+#endif
json_export str JSONisvalid(bit *ret, json *j);
json_export str JSONisobject(bit *ret, json *j);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list