jacktengg commented on code in PR #39030:
URL: https://github.com/apache/doris/pull/39030#discussion_r1713776745


##########
be/src/vec/aggregate_functions/aggregate_function.h:
##########
@@ -457,11 +469,16 @@ class IAggregateFunctionHelper : public 
IAggregateFunction {
         auto* deserialized_place = (AggregateDataPtr)deserialized_data.data();
         for (size_t i = begin; i <= end; ++i) {
             VectorBufferReader buffer_reader(
-                    (assert_cast<const ColumnString&>(column)).get_data_at(i));
-            assert_cast<const Derived*>(this)->create(deserialized_place);
-            DEFER({ assert_cast<const 
Derived*>(this)->destroy(deserialized_place); });
-            assert_cast<const Derived*>(this)->deserialize_and_merge(place, 
deserialized_place,
-                                                                     
buffer_reader, arena);
+                    (assert_cast<const ColumnString&, 
TypeCheckOnRelease::DISABLE>(column))
+                            .get_data_at(i));

Review Comment:
   I think this on should enable  check.
   Also an optimization can be done: perform assert cast outside of the loop, 
including `assert_cast<const Derived*,...>`



##########
be/src/vec/aggregate_functions/aggregate_function.h:
##########
@@ -457,11 +469,16 @@ class IAggregateFunctionHelper : public 
IAggregateFunction {
         auto* deserialized_place = (AggregateDataPtr)deserialized_data.data();
         for (size_t i = begin; i <= end; ++i) {
             VectorBufferReader buffer_reader(
-                    (assert_cast<const ColumnString&>(column)).get_data_at(i));
-            assert_cast<const Derived*>(this)->create(deserialized_place);
-            DEFER({ assert_cast<const 
Derived*>(this)->destroy(deserialized_place); });
-            assert_cast<const Derived*>(this)->deserialize_and_merge(place, 
deserialized_place,
-                                                                     
buffer_reader, arena);
+                    (assert_cast<const ColumnString&, 
TypeCheckOnRelease::DISABLE>(column))
+                            .get_data_at(i));

Review Comment:
   I think this one should enable  check.
   Also an optimization can be done: perform assert cast outside of the loop, 
including `assert_cast<const Derived*,...>`



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