rtpsw commented on code in PR #14352:
URL: https://github.com/apache/arrow/pull/14352#discussion_r1019631299
##########
cpp/src/arrow/compute/kernels/hash_aggregate_test.cc:
##########
@@ -4167,5 +4362,197 @@ TEST(GroupBy, OnlyKeys) {
}
}
}
+
+void TestSegmentKey(const std::shared_ptr<Table>& table, Datum output,
+ const std::vector<Datum>& segment_keys) {
+ ASSERT_OK_AND_ASSIGN(Datum aggregated_and_grouped,
+ AlternatorGroupBy(
+ {
+ table->GetColumnByName("argument"),
+ table->GetColumnByName("argument"),
+ table->GetColumnByName("argument"),
+ },
+ {
+ table->GetColumnByName("key"),
+ },
+ segment_keys,
+ {
+ {"hash_count", nullptr, "agg_0", "hash_count"},
+ {"hash_sum", nullptr, "agg_1", "hash_sum"},
+ {"hash_min_max", nullptr, "agg_2",
"hash_min_max"},
+ }));
+
+ AssertDatumsEqual(output, aggregated_and_grouped, /*verbose=*/true);
+}
+
+Result<std::shared_ptr<Table>> GetSingleSegmentKeyInputAsChunked() {
+ auto table = TableFromJSON(schema({field("argument", float64()),
field("key", int64()),
Review Comment:
This is because both `GetSingleSegmentKeyInputAsChunked` and
`GetSingleSegmentKeyInputAsCombined` are passed in to `TestSingleSegmentKey`,
so they have the same signature, and the latter one returns a `Result` because
it invokes `Table::CombineChunks` which return a `Result`.
--
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]