icexelloss commented on code in PR #34311:
URL: https://github.com/apache/arrow/pull/34311#discussion_r1128135909
##########
cpp/src/arrow/compute/kernels/hash_aggregate_test.cc:
##########
@@ -4202,5 +4551,260 @@ TEST(GroupBy, OnlyKeys) {
/*verbose=*/true);
}
}
+
+INSTANTIATE_TEST_SUITE_P(GroupBy, GroupBy, ::testing::Values(RunGroupByImpl));
+
+class SegmentedScalarGroupBy : public GroupBy {};
+
+class SegmentedKeyGroupBy : public GroupBy {};
+
+void TestSegment(GroupByFunction group_by, const std::shared_ptr<Table>& table,
+ Datum output, const std::vector<Datum>& keys,
+ const std::vector<Datum>& segment_keys, bool scalar) {
+ const char* names[] = {
+ scalar ? "count" : "hash_count",
+ scalar ? "sum" : "hash_sum",
+ scalar ? "min_max" : "hash_min_max",
+ };
+ ASSERT_OK_AND_ASSIGN(Datum aggregated_and_grouped,
+ group_by(
+ {
+ table->GetColumnByName("argument"),
+ table->GetColumnByName("argument"),
+ table->GetColumnByName("argument"),
+ },
+ keys, segment_keys,
+ {
+ {names[0], nullptr, "agg_0", names[0]},
+ {names[1], nullptr, "agg_1", names[1]},
+ {names[2], nullptr, "agg_2", names[2]},
+ },
+ kDefaultUseThreads, /*naive=*/false));
+
+ AssertDatumsEqual(output, aggregated_and_grouped, /*verbose=*/true);
+}
+
+void TestSegmentScalar(GroupByFunction group_by, const std::shared_ptr<Table>&
table,
Review Comment:
What is the difference between `TestSegmentScalar` and `TestSegmentKey`?
--
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]