pitrou commented on code in PR #45822:
URL: https://github.com/apache/arrow/pull/45822#discussion_r2010221977
##########
cpp/src/arrow/compute/row/grouper_test.cc:
##########
@@ -898,42 +1064,88 @@ TEST(Grouper, DoubleStringInt64Key) {
g.ExpectConsume(R"([[-0.0, "be", 7], [0.0, "be", 7]])", "[3, 4]");
}
-TEST(Grouper, RandomInt64Keys) {
- TestGrouper g({int64()});
+FieldVector AnnotateForRandomGeneration(FieldVector fields) {
+ for (auto& field : fields) {
+ // For each field, constrain random generation to ensure that group ids
+ // can appear more than once.
+ if (is_integer(*field->type())) {
+ field =
+ field->WithMergedMetadata(key_value_metadata({"min", "max"}, {"100",
"10000"}));
+ } else if (is_binary_like(*field->type())) {
+ // (note this is unsupported for large binary types)
+ field = field->WithMergedMetadata(key_value_metadata({"unique"},
{"100"}));
+ }
+ field = field->WithMergedMetadata(key_value_metadata({"null_probability"},
{"0.1"}));
+ }
+ return fields;
+}
+
+void TestRandomConsume(TestGrouper g) {
Review Comment:
`Populate` is exercised below in `TestRandomLookup`, or are suggesting
something else?
--
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]