HappenLee commented on code in PR #33055:
URL: https://github.com/apache/doris/pull/33055#discussion_r1554801961


##########
be/src/vec/functions/function_string.cpp:
##########
@@ -57,6 +57,28 @@ struct StringASCII {
     }
 };
 
+struct NameQuote {
+    static constexpr auto name = "quote";
+};
+
+struct NameQuoteImpl {
+    static Status vector(const ColumnString::Chars& data, const 
ColumnString::Offsets& offsets,
+                         ColumnString::Chars& res_data, ColumnString::Offsets& 
res_offsets) {
+        size_t offset_size = offsets.size();
+        res_offsets.resize(offset_size);
+        res_data.reserve(data.size() + offset_size * 2);
+        for (int i = 0; i < offset_size; i++) {
+            const unsigned char* raw_str = &data[offsets[i - 1]];
+            ColumnString::Offset size = offsets[i] - offsets[i - 1];
+            res_data.push_back_without_reserve('\'');
+            res_data.insert_assume_reserved(raw_str, raw_str + size);

Review Comment:
   use memcpy to do the work



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