Mryange commented on code in PR #54582:
URL: https://github.com/apache/doris/pull/54582#discussion_r2302647292


##########
be/src/vec/aggregate_functions/aggregate_function_product.h:
##########
@@ -38,14 +38,42 @@ template <PrimitiveType T>
 struct AggregateFunctionProductData {
     typename PrimitiveTypeTraits<T>::ColumnItemType product {};
 
+    void add_impl(typename PrimitiveTypeTraits<T>::ColumnItemType value,
+                  typename PrimitiveTypeTraits<T>::ColumnItemType& 
product_ref) {
+        if constexpr (std::is_integral_v<typename 
PrimitiveTypeTraits<T>::ColumnItemType>) {
+            typename PrimitiveTypeTraits<T>::ColumnItemType new_product;
+            if (__builtin_expect(__builtin_mul_overflow(product_ref, value, 
&new_product), false)) {

Review Comment:
   be/src/vec/common/arithmetic_overflow.h 下有一个我们自己写的mul_overflow



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

Reply via email to