eldenmoon commented on code in PR #37176:
URL: https://github.com/apache/doris/pull/37176#discussion_r1663933506


##########
be/src/vec/data_types/serde/data_type_string_serde.h:
##########
@@ -73,16 +73,52 @@ class DataTypeStringSerDeBase : public DataTypeSerDe {
         auto result = check_column_const_set_readability(column, row_num);
         ColumnPtr ptr = result.first;
         row_num = result.second;
+        const auto& value = assert_cast<const 
ColumnType&>(*ptr).get_data_at(row_num);
 
         if (_nesting_level > 1) {
             bw.write('"');
         }
-
-        const auto& value = assert_cast<const 
ColumnType&>(*ptr).get_data_at(row_num);
-        bw.write(value.data, value.size);
+        if constexpr (std::is_same_v<ColumnType, ColumnString>) {
+            if (options.escape_char != 0) {
+                // we should make deal with some special characters in json 
str if we have escape_char
+                StringRef str_ref = value;
+                for (char it : str_ref) {

Review Comment:
   put this into a function may enhance readability



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