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

Hongze Zhang commented on CALCITE-2869:
---------------------------------------

[~ritesh.kapoor] - I didn't have a very clear plan on this so far, but it will 
be good if you could share your thoughts.

Currently we use {{SqlTypeName.ANY}} as the type of a JSON value, and use 
{{SqlFunctions.PathContext}} and various Jackson-deserialized types for the 
enumerable level. The fix should add a {{SqlTypeName.JSON}} or something 
similar, and change the existing JSON functions to use the new data type. 
Especially, in {{Parser.jj}}, the expansion {{JsonValueExpression}} should 
return SQL node with the new type, and itself should be a part of the common 
{{Expression}} expansion somehow. After that we can remove the syntax 
definition for most of the MySQL's JSON functions such as {{JSON_TYPE}} and 
{{JSON_PRETTY}}.

Regarding the backward compatibility, so far I think it's OK to just get the 
existing test cases in Calcite passed. Projects using Calcite's planner and 
JSON functions may need to add a new translation for the new data type.

> JSON data type support
> ----------------------
>
>                 Key: CALCITE-2869
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2869
>             Project: Calcite
>          Issue Type: Sub-task
>            Reporter: Hongze Zhang
>            Priority: Major
>
> Some references about JSON data type in other SQL implementations:
> 1. [https://dev.mysql.com/doc/refman/8.0/en/json.html]
> 2. [https://www.postgresql.org/docs/9.5/datatype-json.html]



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

Reply via email to