Changeset: ed3c4f6fcc14 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ed3c4f6fcc14
Modified Files:
monetdb5/modules/atoms/json.c
monetdb5/modules/atoms/json.h
monetdb5/modules/atoms/json.mal
sql/scripts/40_json.sql
Branch: default
Log Message:
Intermediate step to enrich JSON processing
diffs (86 lines):
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
@@ -824,7 +824,7 @@ JSONparse(char *j, int silent)
skipblancs(j);
if( *j ){
if( !silent)
- jt->error = createException(MAL, "json.parser", "Syntax
error");
+ jt->error = createException(MAL, "json.parser", "Syntax
error: json parse failed");
}
return jt;
}
@@ -1578,3 +1578,23 @@ JSONfold(Client cntxt, MalBlkPtr mb, Mal
return JSONfoldKeyValue(ret, id, key, val);
}
+str
+JSONtextString(str *ret, int *bid)
+{
+ (void) ret;
+ (void) bid;
+ throw(MAL,"json.text","tobeimplemented");
+}
+
+
+str
+JSONtextGrouped(int *ret, int *bid, int *gid, int *ext, bit *flg)
+{
+ (void) ret;
+ (void) bid;
+ (void) gid;
+ (void) ext;
+ (void) flg;
+ throw(MAL,"json.text","tobeimplemented");
+}
+
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
@@ -94,6 +94,8 @@ json_export str JSONvalueTable(int *ret,
json_export str JSONkeyArray(json *ret, json *arg);
json_export str JSONvalueArray(json *ret, json *arg);
+json_export str JSONtextString(str *ret, int *bid);
+json_export str JSONtextGrouped(int *ret, int *bid, int *gid, int *ext, bit
*flg);
json_export str JSONdump(int *ret, json *val);
json_export str JSONprelude(int *ret);
diff --git a/monetdb5/modules/atoms/json.mal b/monetdb5/modules/atoms/json.mal
--- a/monetdb5/modules/atoms/json.mal
+++ b/monetdb5/modules/atoms/json.mal
@@ -147,6 +147,14 @@ command values(val:json):bat[:oid,:json]
address JSONvalueTable
comment "Expands the outermost JSON values.";
+command output(b:bat[:oid,:any_1]):str
+address JSONtextString
+comment "Pack the values into a single json structure";
+
+command suboutput(b:bat[:oid,:any_1], gid:bat[:oid,:oid], ext:bat[:oid,:wrd],
flg:bit):bat[:oid,:str]
+address JSONtextGrouped
+comment "Pack the values into a json structure";
+
command prelude()
address JSONprelude;
diff --git a/sql/scripts/40_json.sql b/sql/scripts/40_json.sql
--- a/sql/scripts/40_json.sql
+++ b/sql/scripts/40_json.sql
@@ -75,9 +75,16 @@ returns json external name json.valuear
create function json.text(js json)
returns string external name json.text;
+create function json.text(js string)
+returns string external name json.text;
+create function json.text(js int)
+returns string external name json.text;
-- The remainder awaits the implementation
+create aggregate json.output(js json)
+returns string external name json.output;
+
-- create function json.object(*) returns json external name json.objectrender;
-- create function json.array(*) returns json external name json.arrayrender;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list