Nice document Hongze! Since the functions are only present in MySQL why not create a MySQLOperatorTable and put them there? I went over the discussion in CALCITE-2791 but I did not understand why it is preferable to put them in the SqlStdOperatorTable.
Στις Πέμ, 31 Ιαν 2019 στις 10:51 μ.μ., ο/η Julian Hyde <jh...@apache.org> έγραψε: > +1 > > In the reference doc, let’s make it clear that these are in MySQL but not > in the standard. (Unlike some of their other extensions to standard SQL, > MySQL seem to have done a good job - they are well-designed and > well-documented.) > > > On Jan 31, 2019, at 10:20 AM, Hongze Zhang <notify...@126.com> wrote: > > > > 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 > >