yiguolei commented on code in PR #56600:
URL: https://github.com/apache/doris/pull/56600#discussion_r2390057502


##########
be/src/udf/udf.cpp:
##########
@@ -150,9 +150,9 @@ void* 
FunctionContext::get_function_state(FunctionStateScope scope) const {
     }
 }
 
-StringRef FunctionContext::create_temp_string_val(int64_t len) {
+Slice FunctionContext::create_temp_string_val(int64_t len) {

Review Comment:
   I think you should not change the return type to Slice, because actually we 
need string.
   For example, we have such code:
   StringRef result = context->create_temp_string_val(whole_decimal_str_len);
       char* result_data = const_cast<char*>(result.data);
   
       if (append_sign_manually) {
           memset(result_data, '-', 1);
       }
   
       memcpy(result_data + (append_sign_manually ? 1 : 0), p, integer_str_len);
       *(result_data + whole_decimal_str_len - 3) = '.';
       *(result_data + whole_decimal_str_len - 2) = '0' + 
std::abs(static_cast<int>(frac_value / 10));
       *(result_data + whole_decimal_str_len - 1) = '0' + 
std::abs(static_cast<int>(frac_value % 10));
       return result;
   And stringref has many method to operate on string value, not bytes.



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