zclllyybb commented on code in PR #56648:
URL: https://github.com/apache/doris/pull/56648#discussion_r2439134064
##########
be/src/vec/functions/function_varbinary.cpp:
##########
@@ -59,30 +64,29 @@ class FunctionToBinary : public IFunction {
auto col_res = ColumnVarbinary::create();
const auto& data = col->get_chars();
const auto& offsets = col->get_offsets();
+ col_res->get_data().resize_fill(input_rows_count);
- std::array<char, string_hex::MAX_STACK_CIPHER_LEN> stack_buf;
- std::vector<char> heap_buf;
for (int i = 0; i < input_rows_count; ++i) {
const auto* source = reinterpret_cast<const
char*>(&data[offsets[i - 1]]);
ColumnString::Offset srclen = offsets[i] - offsets[i - 1];
- auto cipher_len = srclen / 2;
+ int cipher_len = srclen / 2;
char* dst = nullptr;
- if (cipher_len <= stack_buf.size()) {
- dst = stack_buf.data();
+ bool cipher_inline = StringView::isInline(cipher_len);
Review Comment:
把这块儿L75-80抽象成一个函数吧
--
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]