From 5a463fedb84791b913c71c82a4772b23047fb5b9 Mon Sep 17 00:00:00 2001 From: zzzxl <33418555+zzzxl1993@users.noreply.github.com> Date: Thu, 21 Sep 2023 15:29:10 +0800 Subject: [PATCH] [optimize](match) optimize unnecessary conversions (#24389) --- be/src/vec/functions/match.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/be/src/vec/functions/match.cpp b/be/src/vec/functions/match.cpp index bba640fa9fd49e..a549762c7da116 100644 --- a/be/src/vec/functions/match.cpp +++ b/be/src/vec/functions/match.cpp @@ -25,7 +25,9 @@ namespace doris::vectorized { Status FunctionMatchBase::execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, size_t result, size_t input_rows_count) { - auto match_query_str = block.get_by_position(arguments[1]).to_string(0); + ColumnPtr& column_ptr = block.get_by_position(arguments[1]).column; + DataTypePtr& type_ptr = block.get_by_position(arguments[1]).type; + auto match_query_str = type_ptr->to_string(*column_ptr, 0); std::string column_name = block.get_by_position(arguments[0]).name; auto match_pred_column_name = BeConsts::BLOCK_TEMP_COLUMN_PREFIX + column_name + "_match_" + match_query_str;