[
https://issues.apache.org/jira/browse/FLINK-37175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gustavo de Morais updated FLINK-37175:
--------------------------------------
Description:
It is currently not possible to declare a SQL string that contains existing
JSON as valid JSON for JSON_OBJECT. Something like
{code:java}
JSON_OBJECT(KEY 'K' VALUE '\{"value": 42}') returns \{"K", "{"value": 42}"}
{code}
Where the value is a string a not a json object.
We should support the JSON() function, at least initial support for it until
this function returns the JSON datatype.
Example:
{code:java}
jsonObject(JsonOnNull.NULL, "nested", json('{"value": 42}'))
JSON_OBJECT(KEY 'K' VALUE JSON('{"value": 42}'))
// {"nested":{"value":42}}{code}
was:
It is currently not possible to declare a SQL string that contains existing
JSON as valid JSON for JSON_OBJECT. If you do something like ??JSON_OBJECT(KEY
'K' VALUE '\{"value": 42}'), you'll have a string, \{"K", "{"value": 42}"},??
as output, an not a json object.
We should support the JSON() function, at least initial support for it until
this function returns the JSON datatype.
Example:
{code:java}
jsonObject(JsonOnNull.NULL, "nested", json('{"value": 42}'))
JSON_OBJECT(KEY 'K' VALUE JSON('{"value": 42}'))
// {"nested":{"value":42}}{code}
> Support JSON built-in function for JSON_OBJECT
> ----------------------------------------------
>
> Key: FLINK-37175
> URL: https://issues.apache.org/jira/browse/FLINK-37175
> Project: Flink
> Issue Type: New Feature
> Components: Table SQL / API
> Reporter: Gustavo de Morais
> Priority: Major
> Fix For: 2.0.0
>
>
> It is currently not possible to declare a SQL string that contains existing
> JSON as valid JSON for JSON_OBJECT. Something like
> {code:java}
> JSON_OBJECT(KEY 'K' VALUE '\{"value": 42}') returns \{"K", "{"value": 42}"}
> {code}
> Where the value is a string a not a json object.
> We should support the JSON() function, at least initial support for it until
> this function returns the JSON datatype.
>
> Example:
> {code:java}
> jsonObject(JsonOnNull.NULL, "nested", json('{"value": 42}'))
> JSON_OBJECT(KEY 'K' VALUE JSON('{"value": 42}'))
> // {"nested":{"value":42}}{code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)