You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/08/18 13:22:11 UTC
[GitHub] [arrow] lidavidm commented on a change in pull request #10931: ARROW-13613: [C++] Add decimal support to (hash) sum/mean/product
lidavidm commented on a change in pull request #10931:
URL: https://github.com/apache/arrow/pull/10931#discussion_r691232175
##########
File path: cpp/src/arrow/compute/kernels/aggregate_test.cc
##########
@@ -556,6 +641,98 @@ TYPED_TEST(TestNumericProductKernel, ScalarAggregateOptions) {
ResultWith(null_result));
}
+TEST(TestDecimalProductKernel, SimpleProduct) {
+ for (const auto& ty : {decimal128(3, 2), decimal256(3, 2)}) {
+ Datum null = ScalarFromJSON(ty, R"(null)");
+
+ EXPECT_THAT(Product(ArrayFromJSON(ty, R"([])")), ResultWith(null));
+ EXPECT_THAT(Product(ArrayFromJSON(ty, R"([null])")), ResultWith(null));
+ EXPECT_THAT(
+ Product(ArrayFromJSON(ty, R"(["0.00", "1.00", "2.00", "3.00", "4.00", "5.00"])")),
+ ResultWith(ScalarFromJSON(ty, R"("0.00")")));
+ Datum chunks =
+ ChunkedArrayFromJSON(ty, {R"(["1.00", "2.00", "3.00", "4.00", "5.00"])"});
Review comment:
Good pointed, updated the tests.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org