Changeset: aee0236bd929 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aee0236bd929
Added Files:
        sql/test/json/Tests/components.sql
        sql/test/json/Tests/pathexpr.stable.err
        sql/test/json/Tests/pathexpr.stable.out
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/SQL-dump.stable.out
        clients/Tests/exports.stable.out
        monetdb5/modules/atoms/Tests/json01.mal
        monetdb5/modules/atoms/Tests/json01.stable.out
        monetdb5/modules/atoms/Tests/json02.mal
        monetdb5/modules/atoms/Tests/json02.stable.out
        monetdb5/modules/atoms/Tests/json05.mal
        monetdb5/modules/atoms/Tests/json05.stable.out
        monetdb5/modules/atoms/Tests/json07.mal
        monetdb5/modules/atoms/Tests/json07.stable.out
        monetdb5/modules/atoms/Tests/json08.mal
        monetdb5/modules/atoms/Tests/json08.stable.out
        monetdb5/modules/atoms/json_atom.c
        monetdb5/modules/atoms/json_atom.h
        monetdb5/modules/atoms/json_atom.mal
        sql/scripts/40_json.sql
        sql/test/json/Tests/All
        sql/test/json/Tests/books.sql
        sql/test/json/Tests/books.stable.out
        sql/test/json/Tests/bulkjson.stable.out
        sql/test/json/Tests/bulkvalid.sql
        sql/test/json/Tests/bulkvalid.stable.out
        sql/test/json/Tests/parsing.stable.err
        sql/test/json/Tests/pathexpr.sql
        sql/test/json/Tests/pgexample.sql
        sql/test/json/Tests/pgexample.stable.out
        sql/test/json/Tests/spaceissue.sql
        sql/test/json/Tests/spaceissue.stable.out
Branch: default
Log Message:

More work on the json interface
Simplified the interface using slightly different names.
Checking more manifold expressions.


diffs (truncated from 2277 to 300 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -39692,27 +39692,29 @@ command json.exportResult(o:streams,kind
 address JSONexportResult;
 comment Serialise the given JSON pointer into JSON format, respecting the MAPI 
protocol
 
-command json.filter(name:json,i:int):json 
+command json.filter(name:json,idx:lng):json 
 address JSONfilterArray;
-comment Extract a single element from an array
-
-command json.filterall(name:json,s:str):json 
-address JSONfilterObjectAll;
-comment Filter the members of an object by name
-
-command json.filter(name:json,s:str):json 
-address JSONfilterObject;
-comment Filter the members of an object by name
+comment Extract a single array element
+
+command json.filter(name:json,idx:int):json 
+address JSONfilterArray;
+command json.filter(name:json,idx:sht):json 
+address JSONfilterArray;
+command json.filter(name:json,idx:bte):json 
+address JSONfilterArray;
+command json.filter(name:json,pathexpr:str):json 
+address JSONfilter;
+comment Filter all members of an object by path expression
 
 command json.#fromstr():json 
 address JSONfromString;
 comment Validate a string to be JSON compliant. A NOOP if valid json, NULL 
otherwise.
 
-command json.isvalidarray(val:json):bit 
+command json.isarray(val:str):bit 
 address JSONisarray;
 comment Validate the string as a valid JSON array
 
-command json.isvalidobject(val:json):bit 
+command json.isobject(val:str):bit 
 address JSONisobject;
 comment Validate the string as a valid JSON object
 
@@ -39720,11 +39722,23 @@ command json.isvalid(val:str):bit
 address JSONisvalid;
 comment Validate the string as a valid JSON document
 
+command json.isarray(val:json):bit 
+address JSONisarray;
+comment Validate the string as a valid JSON array
+
+command json.isobject(val:json):bit 
+address JSONisobject;
+comment Validate the string as a valid JSON object
+
+command json.isvalid(val:json):bit 
+address JSONisvalid;
+comment Validate the string as a valid JSON document
+
 command json.keys(val:json):bat[:oid,:str] 
-address JSONkeys;
+address JSONkeyTable;
 comment Expands the outermost JSON object names.
 
-command json.keyArray(val:json):str 
+command json.keyarray(val:json):str 
 address JSONkeyArray;
 comment Expands the outermost JSON object keys into a JSON array.
 
@@ -39771,10 +39785,6 @@ command json.print(o:streams,kind:bat[:o
 address JSONprint;
 comment Serialise the given JSON pointer into JSON format
 
-command json.path(js:json,e:str):json 
-address JSONpath;
-comment Simple JSON path accessor
-
 command json.prelude():void 
 address JSONprelude;
 command 
json.resultSet(u:bat[:oid,:uuid],rev:bat[:oid,:lng],js:bat[:oid,:json]):json 
@@ -39801,9 +39811,9 @@ command json.str(j:json):str
 address JSONjson2str;
 comment Convert JSON to its string equivalent. Dealing with escape characters
 
-command json.text(js:json,e:str):str 
-address JSONtext;
-comment Simple JSON path accessor, returning the concatenated string
+command json.text(j:json):str 
+address JSONjson2text;
+comment Convert JSON to its plain string equivalent.
 
 command json.#tostr():str 
 address JSONtoString;
@@ -39830,10 +39840,10 @@ address JSONunnestGrouped;
 comment Expands the outermost JSON object into key-value pairs with object 
identity.
 
 command json.values(val:json):bat[:oid,:json] 
-address JSONvalues;
+address JSONvalueTable;
 comment Expands the outermost JSON values.
 
-command json.valueArray(val:json):str 
+command json.valuearray(val:json):str 
 address JSONvalueArray;
 comment Expands the outermost JSON object values into a JSON array.
 
diff --git a/clients/Tests/SQL-dump.stable.out 
b/clients/Tests/SQL-dump.stable.out
--- a/clients/Tests/SQL-dump.stable.out
+++ b/clients/Tests/SQL-dump.stable.out
@@ -1500,7 +1500,7 @@ CREATE TABLE "sys"."_columns" (
        "number"      INTEGER,
        "storage"     VARCHAR(2048)
 );
-COPY 419 RECORDS INTO "sys"."_columns" FROM stdin USING DELIMITERS 
'\t','\n','"';
+COPY 421 RECORDS INTO "sys"."_columns" FROM stdin USING DELIMITERS 
'\t','\n','"';
 2002   "id"    "int"   32      0       2001    NULL    true    0       NULL
 2003   "name"  "varchar"       1024    0       2001    NULL    true    1       
NULL
 2004   "authorization" "int"   32      0       2001    NULL    true    2       
NULL
@@ -1849,77 +1849,79 @@ 5694    "progress"      "int"   32      0       5698    
NULL    tru
 5695   "status"        "clob"  0       0       5698    NULL    true    5       
NULL
 5696   "tag"   "oid"   63      0       5698    NULL    true    6       NULL
 5697   "query" "clob"  0       0       5698    NULL    true    7       NULL
-6267   "schema"        "clob"  0       0       6266    NULL    true    0       
NULL
-6268   "table" "clob"  0       0       6266    NULL    true    1       NULL
-6269   "column"        "clob"  0       0       6266    NULL    true    2       
NULL
-6270   "type"  "clob"  0       0       6266    NULL    true    3       NULL
-6271   "location"      "clob"  0       0       6266    NULL    true    4       
NULL
-6272   "count" "bigint"        64      0       6266    NULL    true    5       
NULL
-6273   "typewidth"     "int"   32      0       6266    NULL    true    6       
NULL
-6274   "columnsize"    "bigint"        64      0       6266    NULL    true    
7       NULL
-6275   "heapsize"      "bigint"        64      0       6266    NULL    true    
8       NULL
-6276   "indices"       "bigint"        64      0       6266    NULL    true    
9       NULL
-6277   "sorted"        "boolean"       1       0       6266    NULL    true    
10      NULL
-6282   "schema"        "clob"  0       0       6293    NULL    true    0       
NULL
-6283   "table" "clob"  0       0       6293    NULL    true    1       NULL
-6284   "column"        "clob"  0       0       6293    NULL    true    2       
NULL
-6285   "type"  "clob"  0       0       6293    NULL    true    3       NULL
-6286   "location"      "clob"  0       0       6293    NULL    true    4       
NULL
-6287   "count" "bigint"        64      0       6293    NULL    true    5       
NULL
-6288   "typewidth"     "int"   32      0       6293    NULL    true    6       
NULL
-6289   "columnsize"    "bigint"        64      0       6293    NULL    true    
7       NULL
-6290   "heapsize"      "bigint"        64      0       6293    NULL    true    
8       NULL
-6291   "indices"       "bigint"        64      0       6293    NULL    true    
9       NULL
-6292   "sorted"        "boolean"       1       0       6293    NULL    true    
10      NULL
-6295   "schema"        "clob"  0       0       6305    NULL    true    0       
NULL
-6296   "table" "clob"  0       0       6305    NULL    true    1       NULL
-6297   "column"        "clob"  0       0       6305    NULL    true    2       
NULL
-6298   "type"  "clob"  0       0       6305    NULL    true    3       NULL
-6299   "typewidth"     "int"   32      0       6305    NULL    true    4       
NULL
-6300   "count" "bigint"        64      0       6305    NULL    true    5       
NULL
-6301   "distinct"      "bigint"        64      0       6305    NULL    true    
6       NULL
-6302   "atomwidth"     "int"   32      0       6305    NULL    true    7       
NULL
-6303   "reference"     "boolean"       1       0       6305    NULL    true    
8       NULL
-6304   "sorted"        "boolean"       1       0       6305    NULL    true    
9       NULL
-6326   "schema"        "clob"  0       0       6325    NULL    true    0       
NULL
-6327   "table" "clob"  0       0       6325    NULL    true    1       NULL
-6328   "column"        "clob"  0       0       6325    NULL    true    2       
NULL
-6329   "type"  "clob"  0       0       6325    NULL    true    3       NULL
-6330   "count" "bigint"        64      0       6325    NULL    true    4       
NULL
-6331   "columnsize"    "bigint"        64      0       6325    NULL    true    
5       NULL
-6332   "heapsize"      "bigint"        64      0       6325    NULL    true    
6       NULL
-6333   "indices"       "bigint"        64      0       6325    NULL    true    
7       NULL
-6334   "sorted"        "boolean"       1       0       6325    NULL    true    
8       NULL
-6339   "schema"        "clob"  0       0       6348    NULL    true    0       
NULL
-6340   "table" "clob"  0       0       6348    NULL    true    1       NULL
-6341   "column"        "clob"  0       0       6348    NULL    true    2       
NULL
-6342   "type"  "clob"  0       0       6348    NULL    true    3       NULL
-6343   "count" "bigint"        64      0       6348    NULL    true    4       
NULL
-6344   "columnsize"    "bigint"        64      0       6348    NULL    true    
5       NULL
-6345   "heapsize"      "bigint"        64      0       6348    NULL    true    
6       NULL
-6346   "indices"       "bigint"        64      0       6348    NULL    true    
7       NULL
-6347   "sorted"        "boolean"       1       0       6348    NULL    true    
8       NULL
-6350   "schema"        "clob"  0       0       6357    NULL    true    0       
NULL
-6351   "table" "clob"  0       0       6357    NULL    true    1       NULL
-6352   "count" "bigint"        64      0       6357    NULL    true    2       
NULL
-6353   "columnsize"    "bigint"        64      0       6357    NULL    true    
3       NULL
-6354   "heapsize"      "bigint"        64      0       6357    NULL    true    
4       NULL
-6355   "indices"       "bigint"        64      0       6357    NULL    true    
5       NULL
-6356   "auxillary"     "bigint"        53      0       6357    NULL    true    
6       NULL
-6359   "schema"        "clob"  0       0       6372    NULL    true    0       
NULL
-6360   "table" "clob"  0       0       6372    NULL    true    1       NULL
-6361   "column"        "clob"  0       0       6372    NULL    true    2       
NULL
-6362   "type"  "clob"  0       0       6372    NULL    true    3       NULL
-6363   "width" "int"   32      0       6372    NULL    true    4       NULL
-6364   "stamp" "timestamp"     7       0       6372    NULL    true    5       
NULL
-6365   "sample"        "bigint"        64      0       6372    NULL    true    
6       NULL
-6366   "count" "bigint"        64      0       6372    NULL    true    7       
NULL
-6367   "unique"        "bigint"        64      0       6372    NULL    true    
8       NULL
-6368   "nils"  "bigint"        64      0       6372    NULL    true    9       
NULL
-6369   "minval"        "clob"  0       0       6372    NULL    true    10      
NULL
-6370   "maxval"        "clob"  0       0       6372    NULL    true    11      
NULL
-6371   "sorted"        "boolean"       1       0       6372    NULL    true    
12      NULL
-6425   "function_id"   "int"   32      0       6426    NULL    true    0       
NULL
+6267   "nme"   "json"  0       0       6266    NULL    true    0       NULL
+6273   "val"   "json"  0       0       6272    NULL    true    0       NULL
+6295   "schema"        "clob"  0       0       6294    NULL    true    0       
NULL
+6296   "table" "clob"  0       0       6294    NULL    true    1       NULL
+6297   "column"        "clob"  0       0       6294    NULL    true    2       
NULL
+6298   "type"  "clob"  0       0       6294    NULL    true    3       NULL
+6299   "location"      "clob"  0       0       6294    NULL    true    4       
NULL
+6300   "count" "bigint"        64      0       6294    NULL    true    5       
NULL
+6301   "typewidth"     "int"   32      0       6294    NULL    true    6       
NULL
+6302   "columnsize"    "bigint"        64      0       6294    NULL    true    
7       NULL
+6303   "heapsize"      "bigint"        64      0       6294    NULL    true    
8       NULL
+6304   "indices"       "bigint"        64      0       6294    NULL    true    
9       NULL
+6305   "sorted"        "boolean"       1       0       6294    NULL    true    
10      NULL
+6310   "schema"        "clob"  0       0       6321    NULL    true    0       
NULL
+6311   "table" "clob"  0       0       6321    NULL    true    1       NULL
+6312   "column"        "clob"  0       0       6321    NULL    true    2       
NULL
+6313   "type"  "clob"  0       0       6321    NULL    true    3       NULL
+6314   "location"      "clob"  0       0       6321    NULL    true    4       
NULL
+6315   "count" "bigint"        64      0       6321    NULL    true    5       
NULL
+6316   "typewidth"     "int"   32      0       6321    NULL    true    6       
NULL
+6317   "columnsize"    "bigint"        64      0       6321    NULL    true    
7       NULL
+6318   "heapsize"      "bigint"        64      0       6321    NULL    true    
8       NULL
+6319   "indices"       "bigint"        64      0       6321    NULL    true    
9       NULL
+6320   "sorted"        "boolean"       1       0       6321    NULL    true    
10      NULL
+6323   "schema"        "clob"  0       0       6333    NULL    true    0       
NULL
+6324   "table" "clob"  0       0       6333    NULL    true    1       NULL
+6325   "column"        "clob"  0       0       6333    NULL    true    2       
NULL
+6326   "type"  "clob"  0       0       6333    NULL    true    3       NULL
+6327   "typewidth"     "int"   32      0       6333    NULL    true    4       
NULL
+6328   "count" "bigint"        64      0       6333    NULL    true    5       
NULL
+6329   "distinct"      "bigint"        64      0       6333    NULL    true    
6       NULL
+6330   "atomwidth"     "int"   32      0       6333    NULL    true    7       
NULL
+6331   "reference"     "boolean"       1       0       6333    NULL    true    
8       NULL
+6332   "sorted"        "boolean"       1       0       6333    NULL    true    
9       NULL
+6354   "schema"        "clob"  0       0       6353    NULL    true    0       
NULL
+6355   "table" "clob"  0       0       6353    NULL    true    1       NULL
+6356   "column"        "clob"  0       0       6353    NULL    true    2       
NULL
+6357   "type"  "clob"  0       0       6353    NULL    true    3       NULL
+6358   "count" "bigint"        64      0       6353    NULL    true    4       
NULL
+6359   "columnsize"    "bigint"        64      0       6353    NULL    true    
5       NULL
+6360   "heapsize"      "bigint"        64      0       6353    NULL    true    
6       NULL
+6361   "indices"       "bigint"        64      0       6353    NULL    true    
7       NULL
+6362   "sorted"        "boolean"       1       0       6353    NULL    true    
8       NULL
+6367   "schema"        "clob"  0       0       6376    NULL    true    0       
NULL
+6368   "table" "clob"  0       0       6376    NULL    true    1       NULL
+6369   "column"        "clob"  0       0       6376    NULL    true    2       
NULL
+6370   "type"  "clob"  0       0       6376    NULL    true    3       NULL
+6371   "count" "bigint"        64      0       6376    NULL    true    4       
NULL
+6372   "columnsize"    "bigint"        64      0       6376    NULL    true    
5       NULL
+6373   "heapsize"      "bigint"        64      0       6376    NULL    true    
6       NULL
+6374   "indices"       "bigint"        64      0       6376    NULL    true    
7       NULL
+6375   "sorted"        "boolean"       1       0       6376    NULL    true    
8       NULL
+6378   "schema"        "clob"  0       0       6385    NULL    true    0       
NULL
+6379   "table" "clob"  0       0       6385    NULL    true    1       NULL
+6380   "count" "bigint"        64      0       6385    NULL    true    2       
NULL
+6381   "columnsize"    "bigint"        64      0       6385    NULL    true    
3       NULL
+6382   "heapsize"      "bigint"        64      0       6385    NULL    true    
4       NULL
+6383   "indices"       "bigint"        64      0       6385    NULL    true    
5       NULL
+6384   "auxillary"     "bigint"        53      0       6385    NULL    true    
6       NULL
+6387   "schema"        "clob"  0       0       6400    NULL    true    0       
NULL
+6388   "table" "clob"  0       0       6400    NULL    true    1       NULL
+6389   "column"        "clob"  0       0       6400    NULL    true    2       
NULL
+6390   "type"  "clob"  0       0       6400    NULL    true    3       NULL
+6391   "width" "int"   32      0       6400    NULL    true    4       NULL
+6392   "stamp" "timestamp"     7       0       6400    NULL    true    5       
NULL
+6393   "sample"        "bigint"        64      0       6400    NULL    true    
6       NULL
+6394   "count" "bigint"        64      0       6400    NULL    true    7       
NULL
+6395   "unique"        "bigint"        64      0       6400    NULL    true    
8       NULL
+6396   "nils"  "bigint"        64      0       6400    NULL    true    9       
NULL
+6397   "minval"        "clob"  0       0       6400    NULL    true    10      
NULL
+6398   "maxval"        "clob"  0       0       6400    NULL    true    11      
NULL
+6399   "sorted"        "boolean"       1       0       6400    NULL    true    
12      NULL
+6453   "function_id"   "int"   32      0       6454    NULL    true    0       
NULL
 COMMIT;
 START TRANSACTION;
 CREATE TABLE "sys"."_tables" (
@@ -1932,7 +1934,7 @@ CREATE TABLE "sys"."_tables" (
        "commit_action" SMALLINT,
        "readonly"      BOOLEAN
 );
-COPY 72 RECORDS INTO "sys"."_tables" FROM stdin USING DELIMITERS '\t','\n','"';
+COPY 74 RECORDS INTO "sys"."_tables" FROM stdin USING DELIMITERS '\t','\n','"';
 2001   "schemas"       2000    NULL    0       true    0       false
 2007   "types" 2000    NULL    0       true    0       false
 2016   "functions"     2000    NULL    0       true    0       false
@@ -1997,14 +1999,16 @@ 5656    "environment"   2000    "create view sys
 5657   "#bbp"  2000    NULL    2       true    0       false
 5677   "#queue"        2000    NULL    2       true    0       false
 5698   "queue" 2000    "create view sys.queue as select * from sys.queue();"   
1       true    0       false
-6266   "#storage"      2000    NULL    2       true    0       false
-6293   "storage"       2000    "create view sys.storage as select * from 
sys.storage();"       1       true    0       false
-6305   "storagemodelinput"     2000    NULL    0       true    0       false
-6325   "#storagemodel" 2000    NULL    2       true    0       false
-6348   "storagemodel"  2000    "create view sys.storagemodel as select * from 
sys.storagemodel();"     1       true    0       false
-6357   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxillary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
\"schema\",\"table\",max(count) as \"count\",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(indices) as 
indices,\n\tsum(case when sorted = false then 8 * count else 0 end) as 
auxillary\nfrom sys.storagemodel() group by \"schema\",\"table\";"       1      
 true    0       false
-6372   "statistics"    2000    NULL    0       true    0       false
-6426   "systemfunctions"       2000    NULL    0       true    0       false
+6266   "#keyarray"     2000    NULL    2       true    0       false
+6272   "#valuearray"   2000    NULL    2       true    0       false
+6294   "#storage"      2000    NULL    2       true    0       false
+6321   "storage"       2000    "create view sys.storage as select * from 
sys.storage();"       1       true    0       false
+6333   "storagemodelinput"     2000    NULL    0       true    0       false
+6353   "#storagemodel" 2000    NULL    2       true    0       false
+6376   "storagemodel"  2000    "create view sys.storagemodel as select * from 
sys.storagemodel();"     1       true    0       false
+6385   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxillary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
\"schema\",\"table\",max(count) as \"count\",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(indices) as 
indices,\n\tsum(case when sorted = false then 8 * count else 0 end) as 
auxillary\nfrom sys.storagemodel() group by \"schema\",\"table\";"       1      
 true    0       false
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to