Tanya-W commented on code in PR #13035:
URL: https://github.com/apache/doris/pull/13035#discussion_r1057423658


##########
be/src/vec/exprs/vectorized_fn_call.cpp:
##########
@@ -104,12 +104,38 @@ doris::Status VectorizedFnCall::execute(VExprContext* 
context, doris::vectorized
     size_t num_columns_without_result = block->columns();
     // prepare a column to save result
     block->insert({nullptr, _data_type, _expr_name});
+    if (_function->can_fast_execute()) {
+        bool ok = fast_execute(context->fn_context(_fn_context_index), *block, 
arguments,
+                               num_columns_without_result, block->rows());
+        if (ok) {
+            *result_column_id = num_columns_without_result;
+            return Status::OK();
+        }
+    }
+
     RETURN_IF_ERROR(_function->execute(context->fn_context(_fn_context_index), 
*block, arguments,
                                        num_columns_without_result, 
block->rows(), false));
     *result_column_id = num_columns_without_result;
     return Status::OK();
 }
 
+bool VectorizedFnCall::fast_execute(FunctionContext* context, Block& block,
+                                    const ColumnNumbers& arguments, size_t 
result,
+                                    size_t input_rows_count) {
+    auto column_with_name = block.get_by_position(arguments[1]);
+    auto query_value = column_with_name.to_string(0);
+    std::string column_name = block.get_by_position(arguments[0]).name;
+    auto result_column_name = column_name + "_" + _function->get_name() + "_" 
+ query_value;

Review Comment:
   It's a good idea. I will try it later



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