anupamaggarwal opened a new pull request, #24967:
URL: https://github.com/apache/flink/pull/24967

   
   ## What is the purpose of the change
   
   Adds implementation of `json_quote` and `json_unquote` functions.
   PR is a continuation of https://github.com/apache/flink/pull/24156 and 
addresses feedback received on the original PR.
   
   
   ## Brief change log / changes compared to PR 24156
   
   - Update implementation for `json_quote` with escaping logic
   - Update implementation for `json_unquote` to unescape special characters
     - Delegates valid json checking to SqlJsonUtils#isJsonValue
   - Add/ update some additional tests
   - Updates documentation to remove reference to MySql utf8mb4 encoding
   
   
   ## Open questions
   - High level behavior for invalid json in json_unquote (pass original input 
as is, Vs throwing exception) 
   - To check for JSON_VALIDITY for `json_unquote` logic for `IS JSON` is used 
but in certain cases `IS JSON` behaviour does not seem to be consistent with 
Json spec as documented here https://www.json.org/json-en.html 
     - According to json spec `""""` should not be a valid json (which is also 
flagged by JsonLint) but `select '""""' IS JSON` returns true 
          -  In case of invalid json string for json_unquote an exception is 
thrown in case of Mysql (However we won't do the same) 
   
   
   ### References
   - postgres implementation for 
[escape](https://github.com/postgres/postgres/blob/524d64ea8e3e49b4fda41ff9b2f048b697384058/src/backend/utils/adt/json.c#L2458)
 
   
   ## Verifying this change
   
   - Added ITs in JsonFunctionsITCase
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? (docs)
   


-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to