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

Ingo Bürk commented on FLINK-24387:
-----------------------------------

I wasn't clear on that on the issue, but the name "TO_JSON" wasn't yet set in 
stone, of course. However, I don't think "JSON" makes a good name since that'd 
be the name of the data type if some day we introduce it, and JSON_VALUE is 
already taken (that's another function akin to JSON_QUERY). "TO_JSON" also has 
justification with "IS JSON", IMO, but we could also consider something like 
JSON_STRINGIFY or TO_JSON_STRING since TO_JSON could once again be problematic 
if we had a separate JSON data type.

I'm not sure I understand the second part; the example in the issue is not "a 
particular case", it's a generic workaround to achieve what TO_JSON would 
essentially do. The point is to convert data directly into a JSON string 
without wrapping it into an object/array.

> Support a "to JSON" function
> ----------------------------
>
>                 Key: FLINK-24387
>                 URL: https://issues.apache.org/jira/browse/FLINK-24387
>             Project: Flink
>          Issue Type: Sub-task
>            Reporter: Ingo Bürk
>            Priority: Major
>
> We should consider adding a TO_JSON function which can simply convert some 
> (supported) type directly into a JSON representation, e.g. the equivalent of 
> doing
> {code:java}
> JSON_QUERY(JSON_ARRAY(x), '$.[0]'){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to