[ 
https://issues.apache.org/jira/browse/CALCITE-2791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16767561#comment-16767561
 ] 

Julian Hyde commented on CALCITE-2791:
--------------------------------------

I like that you have added some examples to the doc. But instead of making it a 
table, how about showing SQL? Something like this:
{code:java}
SELECT JSON_TYPE(v) AS c1,
  JSON_TYPE(v.a) AS c2,
  JSON_TYPE(v.a[0]) AS c3,
  JSON_TYPE(v.a[1]) AS c4
FROM VALUES ('{"a": [10, true]}') AS t(v);

c1      c2      c3      c4
======= ======= ======= =======
OBJECT  ARRAY   INTEGER BOOLEAN
{code}

(I probably got the syntax wrong.) SQL is more useful because people can try it 
directly. And it's easier for future authors to extend it with their own 
examples.

> Add the JSON_TYPE function
> --------------------------
>
>                 Key: CALCITE-2791
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2791
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Forward Xu
>            Assignee: Julian Hyde
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The data in json can be =, <, <=, >, >=, <>,! =, and <=>. But the data types 
> in json can be diverse, so when you compare different types, you have a 
> priority, and the high priority is greater than the low priority (you can 
> view the types with the JSON_TYPE() function). The priorities are as follows:
>  BOOLEAN
>  ARRAY
>  OBJECT
>  STRING
>  INTEGER
> DOUBLE
>  NULL



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to