hi Hongze Zhang??
   This makes sense to me, which is why I added the json_type function in the 
first place. Thank you very much.
best
qianjin






------------------ ???????? ------------------
??????: "Hongze Zhang"<[email protected]>;
????????: 2019??2??1??(??????) ????2:20
??????: "[email protected]"<[email protected]>;

????: Integrating MySQL's JSON functions



Hi all,


There is a PR CALCITE-2791[1] from xuqianjin about adding a MySQL function 
JSON_TYPE[2], and I want to know what do you think about it.


JSON_TYPE is not a standard JSON function defined by SQL:2016. In MySQL the use 
of this function is to get the type of a JSON doc. The similar operator in 
Calcite 1.18.0 is "IS JSON (VALUE/SCALAR/OBJECT/ARRAY)", however sometimes 
JSON_TYPE can do more than it.

As for other non-standard JSON functions, I made a simple summary table about 
JSON support (mainly as functions) details of some of most important SQL 
implementations. you can open it via link 
https://docs.google.com/spreadsheets/d/1A6vrEEu3WK49dJ5mfaYeMLFvAy0JR9uoJsiaKhxUal4/edit#gid=0


And I suggest to introduce some JSON functions that is from MySQL and might be 
useful for Calcite but not supported, not Just JSON_TYPE:
1. JSON_INSERT / JSON_SET / JSON_REPLACE /JSON_REMOVE [3]
2. JSON_DEPTH / JSON_LENGTH / JSON_TYPE [4]
I think the PR[1] can be a good start.


Does anyone have thought about this? Looking forward to your reply.


[1] https://issues.apache.org/jira/browse/CALCITE-2791
[2] 
https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html#function_json-type
[3] https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html
[4] https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html

Reply via email to