imay commented on a change in pull request #3345:
URL: https://github.com/apache/incubator-doris/pull/3345#discussion_r420689803
##########
File path: gensrc/script/doris_builtins_functions.py
##########
@@ -533,6 +533,8 @@
'15FunctionContextERKNS1_9StringValERKNS1_6IntValES6_'],
[['length'], 'INT', ['VARCHAR'],
'_ZN5doris15StringFunctions6lengthEPN9doris_udf15FunctionContextERKNS1_9StringValE'],
+ [['char_length'], 'INT', ['VARCHAR'],
Review comment:
```suggestion
[['char_length', 'character_length'], 'INT', ['VARCHAR'],
```
Prefer above type
##########
File path: be/src/exprs/string_functions.cpp
##########
@@ -260,13 +321,16 @@ StringVal StringFunctions::reverse(FunctionContext*
context, const StringVal& st
return StringVal::null();
}
- // TODO pengyubing
- // StringVal result = StringVal::create_temp_string_val(context, str.len);
StringVal result(context, str.len);
if (UNLIKELY(result.is_null)) {
return result;
}
- std::reverse_copy(str.ptr, str.ptr + str.len, result.ptr);
+
+ for (size_t i = 0, char_size = 0; i < str.len; i += char_size) {
Review comment:
Should change function `reverse` documentation
##########
File path:
docs/documentation/cn/sql-reference/sql-functions/string-functions/char_length.md
##########
@@ -0,0 +1,47 @@
+<!--
Review comment:
Should change this document according to current document format.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]