snuyanzin commented on PR #24156:
URL: https://github.com/apache/flink/pull/24156#issuecomment-1938742257
> and json_unqote("\\"key\\"") will produce the same ("\\"key\\"") since the
input ("\\"key\\"") is not a valid json.
can you clarify why it the input here is not a valid json?
Based on [1]
valid json is an element
> json
> element
which is a value separated by whitespaces
> element
ws value ws
and value itself could be a string
> value
object
array
string
number
"true"
"false"
"null"
which is characters
>string
'"' characters '"'
>characters
""
character characters
and characters could contain escape characters
>character
'0020' . '10FFFF' - '"' - '\'
'\' escape
like that
>escape
'"'
'\'
'/'
'b'
'f'
'n'
'r'
't'
'u' hex hex hex hex
so I didn't get why `"\"key\""` should be considered as an invalid json...
Can you elaborate here please?
By the way I checked these queries against MySQL and it works as expected [2]
```SQL
select json_unquote(json_quote("\"key\""));
select json_unquote(json_quote("\"key\": \"value\""));
```
it returns
```
"key"
"key": "value"
```
[1] https://www.json.org/json-en.html
[2] https://www.db-fiddle.com/f/fuuT4xzfFEbY772eNkLkmp/0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]