You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/06/09 00:44:19 UTC

[doris] branch master updated: [bug](udaf) fix java-udaf can't exectue add function (#20554)

This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new d03bd73795 [bug](udaf) fix java-udaf can't exectue add function (#20554)
d03bd73795 is described below

commit d03bd73795a7ee38d63be24d741d54766f6ce121
Author: zhangstar333 <87...@users.noreply.github.com>
AuthorDate: Fri Jun 9 08:44:12 2023 +0800

    [bug](udaf) fix java-udaf can't exectue add function (#20554)
    
    In some case of agg function, maybe running as streaming agg firstly,
    this will call the add function when serialize, so need implement add function also.
---
 .../vec/aggregate_functions/aggregate_function_java_udaf.h  | 13 +++++++++----
 be/src/vec/exprs/vectorized_agg_fn.cpp                      |  1 +
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/be/src/vec/aggregate_functions/aggregate_function_java_udaf.h b/be/src/vec/aggregate_functions/aggregate_function_java_udaf.h
index b51aed7849..fa0c4efd9d 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_java_udaf.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_java_udaf.h
@@ -479,11 +479,16 @@ public:
 
     DataTypePtr get_return_type() const override { return _return_type; }
 
-    void add(AggregateDataPtr __restrict /*place*/, const IColumn** /*columns*/, size_t /*row_num*/,
+    void add(AggregateDataPtr __restrict place, const IColumn** columns, size_t row_num,
              Arena*) const override {
-        LOG(WARNING) << " shouldn't going add function, there maybe some error about function "
-                     << _fn.name.function_name;
-        throw doris::Exception(ErrorCode::INTERNAL_ERROR, "shouldn't going add function");
+        int64_t places_address[1];
+        places_address[0] = reinterpret_cast<int64_t>(place);
+        Status st =
+                this->data(_exec_place)
+                        .add(places_address, true, columns, row_num, row_num + 1, argument_types);
+        if (UNLIKELY(st != Status::OK())) {
+            throw doris::Exception(ErrorCode::INTERNAL_ERROR, st.to_string());
+        }
     }
 
     void add_batch(size_t batch_size, AggregateDataPtr* places, size_t place_offset,
diff --git a/be/src/vec/exprs/vectorized_agg_fn.cpp b/be/src/vec/exprs/vectorized_agg_fn.cpp
index cb2f4cadab..96eb34e3a9 100644
--- a/be/src/vec/exprs/vectorized_agg_fn.cpp
+++ b/be/src/vec/exprs/vectorized_agg_fn.cpp
@@ -273,6 +273,7 @@ std::string AggFnEvaluator::debug_string(const std::vector<AggFnEvaluator*>& exp
 std::string AggFnEvaluator::debug_string() const {
     std::stringstream out;
     out << "AggFnEvaluator(";
+    out << _fn.signature;
     out << ")";
     return out.str();
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org