Changeset: c39c3fcbc16e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c39c3fcbc16e Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 monetdb5/modules/atoms/json.mal Branch: Jul2015 Log Message:
Add comparison function for JSON objects. diffs (truncated from 324 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 @@ -4493,6 +4493,10 @@ pattern batcalc.!=(b1:bat[:oid,:date],b2 address CMDbatNE; comment Return B1 != B2 +pattern batcalc.!=(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatNE; +comment Return B1 != B2 + pattern batcalc.!=(b1:bat[:oid,:uuid],b2:bat[:oid,:uuid]):bat[:oid,:bit] address CMDbatNE; comment Return B1 != B2 @@ -15105,6 +15109,14 @@ pattern batcalc.<(b1:bat[:oid,:date],b2: address CMDbatLT; comment Return B1 < B2 +pattern batcalc.<=(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatLE; +comment Return B1 <= B2 + +pattern batcalc.<(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatLT; +comment Return B1 < B2 + pattern batcalc.<=(b1:bat[:oid,:uuid],b2:bat[:oid,:uuid]):bat[:oid,:bit] address CMDbatLE; comment Return B1 <= B2 @@ -16433,6 +16445,10 @@ pattern batcalc.==(b1:bat[:oid,:date],b2 address CMDbatEQ; comment Return B1 == B2 +pattern batcalc.==(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatEQ; +comment Return B1 == B2 + pattern batcalc.==(b1:bat[:oid,:uuid],b2:bat[:oid,:uuid]):bat[:oid,:bit] address CMDbatEQ; comment Return B1 == B2 @@ -19677,6 +19693,14 @@ pattern batcalc.>(b1:bat[:oid,:date],b2: address CMDbatGT; comment Return B1 > B2 +pattern batcalc.>=(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatGE; +comment Return B1 >= B2 + +pattern batcalc.>(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatGT; +comment Return B1 > B2 + pattern batcalc.>=(b1:bat[:oid,:uuid],b2:bat[:oid,:uuid]):bat[:oid,:bit] address CMDbatGE; comment Return B1 >= B2 @@ -31779,6 +31803,10 @@ pattern calc.!=(v:date,w:date):bit address CMDvarNE; comment Equality of two dates +pattern calc.!=(l:json,r:json):bit +address CMDvarNE; +comment Return V1 != V2 + pattern calc.!=(l:uuid,r:uuid):bit address CMDvarNE; comment Return V1 != V2 @@ -33887,6 +33915,14 @@ pattern calc.<(v:date,w:date):bit address CMDvarLT; comment Equality of two dates +pattern calc.<=(l:json,r:json):bit +address CMDvarLE; +comment Return V1 <= V2 + +pattern calc.<(l:json,r:json):bit +address CMDvarLT; +comment Return V1 < V2 + pattern calc.<=(l:uuid,r:uuid):bit address CMDvarLE; comment Return V1 <= V2 @@ -34119,6 +34155,10 @@ pattern calc.==(v:date,w:date):bit address CMDvarEQ; comment Equality of two dates +pattern calc.==(l:json,r:json):bit +address CMDvarEQ; +comment Return V1 == V2 + pattern calc.==(l:uuid,r:uuid):bit address CMDvarEQ; comment Return V1 == V2 @@ -34671,6 +34711,14 @@ pattern calc.>(v:date,w:date):bit address CMDvarGT; comment Equality of two dates +pattern calc.>=(l:json,r:json):bit +address CMDvarGE; +comment Return V1 >= V2 + +pattern calc.>(l:json,r:json):bit +address CMDvarGT; +comment Return V1 > V2 + pattern calc.>=(l:uuid,r:uuid):bit address CMDvarGE; comment Return V1 >= V2 @@ -38650,7 +38698,7 @@ comment Validate the string as a valid J command json.integer(j:json):lng address JSONjson2integer; -comment Convert sinple JSON values to an integer, return nil upon error. +comment Convert simple JSON values to an integer, return nil upon error. command json.keys(val:json):bat[:oid,:str] address JSONkeyTable; @@ -38666,7 +38714,7 @@ comment Returns the number of elements i command json.number(j:json):dbl address JSONjson2number; -comment Convert sinple JSON values to a double, return nil upon error. +comment Convert simple JSON values to a double, return nil upon error. command json.new(j:str):json address JSONstr2json; diff --git a/clients/Tests/MAL-signatures.stable.out.int128 b/clients/Tests/MAL-signatures.stable.out.int128 --- a/clients/Tests/MAL-signatures.stable.out.int128 +++ b/clients/Tests/MAL-signatures.stable.out.int128 @@ -5376,6 +5376,10 @@ pattern batcalc.!=(b1:bat[:oid,:date],b2 address CMDbatNE; comment Return B1 != B2 +pattern batcalc.!=(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatNE; +comment Return B1 != B2 + pattern batcalc.!=(b1:bat[:oid,:uuid],b2:bat[:oid,:uuid]):bat[:oid,:bit] address CMDbatNE; comment Return B1 != B2 @@ -19444,6 +19448,14 @@ pattern batcalc.<(b1:bat[:oid,:date],b2: address CMDbatLT; comment Return B1 < B2 +pattern batcalc.<=(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatLE; +comment Return B1 <= B2 + +pattern batcalc.<(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatLT; +comment Return B1 < B2 + pattern batcalc.<=(b1:bat[:oid,:uuid],b2:bat[:oid,:uuid]):bat[:oid,:bit] address CMDbatLE; comment Return B1 <= B2 @@ -21132,6 +21144,10 @@ pattern batcalc.==(b1:bat[:oid,:date],b2 address CMDbatEQ; comment Return B1 == B2 +pattern batcalc.==(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatEQ; +comment Return B1 == B2 + pattern batcalc.==(b1:bat[:oid,:uuid],b2:bat[:oid,:uuid]):bat[:oid,:bit] address CMDbatEQ; comment Return B1 == B2 @@ -25360,6 +25376,14 @@ pattern batcalc.>(b1:bat[:oid,:date],b2: address CMDbatGT; comment Return B1 > B2 +pattern batcalc.>=(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatGE; +comment Return B1 >= B2 + +pattern batcalc.>(b1:bat[:oid,:json],b2:bat[:oid,:json]):bat[:oid,:bit] +address CMDbatGT; +comment Return B1 > B2 + pattern batcalc.>=(b1:bat[:oid,:uuid],b2:bat[:oid,:uuid]):bat[:oid,:bit] address CMDbatGE; comment Return B1 >= B2 @@ -40884,6 +40908,10 @@ pattern calc.!=(v:date,w:date):bit address CMDvarNE; comment Equality of two dates +pattern calc.!=(l:json,r:json):bit +address CMDvarNE; +comment Return V1 != V2 + pattern calc.!=(l:uuid,r:uuid):bit address CMDvarNE; comment Return V1 != V2 @@ -43780,6 +43808,14 @@ pattern calc.<(v:date,w:date):bit address CMDvarLT; comment Equality of two dates +pattern calc.<=(l:json,r:json):bit +address CMDvarLE; +comment Return V1 <= V2 + +pattern calc.<(l:json,r:json):bit +address CMDvarLT; +comment Return V1 < V2 + pattern calc.<=(l:uuid,r:uuid):bit address CMDvarLE; comment Return V1 <= V2 @@ -44072,6 +44108,10 @@ pattern calc.==(v:date,w:date):bit address CMDvarEQ; comment Equality of two dates +pattern calc.==(l:json,r:json):bit +address CMDvarEQ; +comment Return V1 == V2 + pattern calc.==(l:uuid,r:uuid):bit address CMDvarEQ; comment Return V1 == V2 @@ -44788,6 +44828,14 @@ pattern calc.>(v:date,w:date):bit address CMDvarGT; comment Equality of two dates +pattern calc.>=(l:json,r:json):bit +address CMDvarGE; +comment Return V1 >= V2 + +pattern calc.>(l:json,r:json):bit +address CMDvarGT; +comment Return V1 > V2 + pattern calc.>=(l:uuid,r:uuid):bit address CMDvarGE; comment Return V1 >= V2 @@ -49575,7 +49623,7 @@ comment Validate the string as a valid J command json.integer(j:json):lng address JSONjson2integer; -comment Convert sinple JSON values to an integer, return nil upon error. +comment Convert simple JSON values to an integer, return nil upon error. command json.keys(val:json):bat[:oid,:str] address JSONkeyTable; @@ -49591,7 +49639,7 @@ comment Returns the number of elements i command json.number(j:json):dbl address JSONjson2number; -comment Convert sinple JSON values to a double, return nil upon error. +comment Convert simple JSON values to a double, return nil upon error. command json.new(j:str):json address JSONstr2json; 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 @@ -40,11 +40,11 @@ comment "Convert JSON values to their pl command number(j:json):dbl address JSONjson2number -comment "Convert sinple JSON values to a double, return nil upon error."; +comment "Convert simple JSON values to a double, return nil upon error."; command integer(j:json):lng address JSONjson2integer -comment "Convert sinple JSON values to an integer, return nil upon error."; +comment "Convert simple JSON values to an integer, return nil upon error."; command dump(j:json):void address JSONdump; @@ -177,4 +177,56 @@ command aggr.subjsonaggr(val:bat[:oid,:d address JSONsubjsoncand comment "Grouped aggregation of values with candidates list."; +module calc; + +pattern ==(l:json,r:json):bit +address CMDvarEQ +comment "Return V1 == V2"; + +pattern !=(l:json,r:json):bit +address CMDvarNE +comment "Return V1 != V2"; + +pattern <(l:json,r:json):bit +address CMDvarLT +comment "Return V1 < V2"; + +pattern <=(l:json,r:json):bit +address CMDvarLE +comment "Return V1 <= V2"; + +pattern >(l:json,r:json):bit +address CMDvarGT +comment "Return V1 > V2"; + +pattern >=(l:json,r:json):bit +address CMDvarGE +comment "Return V1 >= V2"; + +module batcalc; + +pattern ==(b1:bat[:oid,:json],b2:bat[:oid,:json]) :bat[:oid,:bit] _______________________________________________ checkin-list mailing list [email protected] https://www.monetdb.org/mailman/listinfo/checkin-list
