unreal-asr opened a new issue, #51555:
URL: https://github.com/apache/doris/issues/51555

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Description
   
   Similar to [this 
request](https://github.com/apache/doris/issues/21268#issue-1778059156) the 
problem is that even in Apache Doris 3.x  there is no simple way to add a path 
to a non existing object. All json editing functions in doc, always report 
"Otherwise, a path-value pair for a non-existent path in the json is ignored 
and has no effect." 
   A function similar to JSON_MERGE_PATCH is needed (mysql like)
   
   ### Solution
   
   Example:
   
    SELECT JSON_MERGE_PATCH('{"name": "x"}', '{"id": 47}');
   +-------------------------------------------------+
   | JSON_MERGE_PATCH('{"name": "x"}', '{"id": 47}') |
   +-------------------------------------------------+
   | {"id": 47, "name": "x"}                         |
   +-------------------------------------------------+
   
   OR
   
   SELECT JSON_MERGE_PATCH('{ "a": 1, "b":2 }', '{ "a": 3, "c":4 }');
   +-----------------------------------------------------------+
   | JSON_MERGE_PATCH('{ "a": 1, "b":2 }','{ "a": 3, "c":4 }') |
   +-----------------------------------------------------------+
   | {"a": 3, "b": 2, "c": 4}                                  |
   +-----------------------------------------------------------+
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to