You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "github-actions[bot] (via GitHub)" <gi...@apache.org> on 2023/03/22 03:24:07 UTC

[GitHub] [doris] github-actions[bot] commented on a diff in pull request #18014: [Bug](array_product) Fix array_product for ARRAY

github-actions[bot] commented on code in PR #18014:
URL: https://github.com/apache/doris/pull/18014#discussion_r1144191153


##########
be/src/vec/aggregate_functions/aggregate_function_product.h:
##########
@@ -77,6 +77,30 @@ struct AggregateFunctionProductData<Decimal128> {
     void reset(Decimal128 value) { product = std::move(value); }
 };
 
+template <>
+struct AggregateFunctionProductData<Decimal128I> {
+    Decimal128I product {};
+
+    template <typename NestedType>
+    void add(Decimal<NestedType> value, UInt32 scale) {
+        product *= value;
+        product /= DataTypeDecimal<Decimal128I>::get_scale_multiplier(scale);
+    }
+
+    void merge(const AggregateFunctionProductData& other, UInt32 scale) {
+        product *= other.product;
+        product /= DataTypeDecimal<Decimal128I>::get_scale_multiplier(scale);
+    }
+
+    void write(BufferWritable& buffer) const { write_binary(product, buffer); }
+
+    void read(BufferReadable& buffer) { read_binary(product, buffer); }
+
+    Decimal128 get() const { return product; }
+
+    void reset(Decimal128 value) { product = std::move(value); }

Review Comment:
   warning: std::move of the variable 'value' of the trivially-copyable type 'doris::vectorized::Decimal128' (aka 'Decimal<__int128>') has no effect; remove std::move() [performance-move-const-arg]
   
   ```suggestion
       void reset(Decimal128 value) { product = value; }
   ```
   



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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