amorynan commented on code in PR #1576:
URL: https://github.com/apache/doris-website/pull/1576#discussion_r1897069094


##########
docs/sql-manual/sql-data-types/semi-structured/JSON.md:
##########
@@ -56,6 +56,8 @@ INSERT INTO table_name(id, json_column_name) VALUES (1, 
'{"k1": "100"}')
 14     [123, 456]
 ```
 
+- When the newline character `"\n"` appears in JSON, you need to use the 
replace function to replace `"\n"` with `"\\n"` 

Review Comment:
   there just not only \n , just all special character with '\' such as '\r', 
'\t'
   and can u supplement the resolve method like this
   ```
   select 
     json_parse(
       replace(
         cast(
           
'[{"_id":"xxx","index":0,"guid":"xxx-b2d4-477a-8962-4c36e554c21d","isActive":false,"balance":"$1,228.18","picture":"http://xxx.it/32x32","age":22,"eyeColor":"green","name":"xxx
 
xxx","gender":"female","company":"xxxx","email":"x...@xxx.com","phone":"xxx","address":"xxx
 xxx Place, Caln, xxx","about":" Adipisicing reprehenderit sit qui eiusmod 
dolore nostrud commodo proident minim ut ut deserunt 
ullamco.\r\n","registered":"2019-02-08T05:19:25 
-08:00","latitude":12.029664,"longitude":164.711199,"tags":["exercitation","est","consequat","irure","laborum","cillum","irure"],"friends":[{"id":0,"name":"xxx
 Johns"},{"id":1,"name":"xxx Hutchinson"},{"id":2,"name":"xxx 
Castro"}],"greeting":"xxxxx unread xxx.","favoriteFruit":"apple"}]' as VARCHAR
         ), 
         '\r\n', 
         '\\r\\n'
       )
     );
   ```



-- 
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: commits-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to