MCPcopy Create free account
hub / github.com/apache/arrow / TestRandomLookup

Function TestRandomLookup

cpp/src/arrow/compute/row/grouper_test.cc:1094–1105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1092}
1093
1094void TestRandomLookup(TestGrouper g) {
1095 // Exercise Populate then Lookup
1096 auto fields = AnnotateForRandomGeneration(g.key_schema_->fields());
1097 ExecBatch key_batch{*random::GenerateBatch(fields, 1 << 12, /*seed=*/1)};
1098 ASSERT_OK(g.grouper_->Populate(ExecSpan{key_batch}));
1099 for (int i = 0; i < 4; ++i) {
1100 SCOPED_TRACE(ToChars(i) + "th key batch");
1101
1102 ExecBatch key_batch{*random::GenerateBatch(fields, 1 << 12, /*seed=*/i + 1)};
1103 g.LookupAndValidate(key_batch);
1104 }
1105}
1106
1107TEST(Grouper, RandomInt64Keys) {
1108 TestRandomConsume(TestGrouper({int64()}));

Callers 1

TESTFunction · 0.85

Calls 6

GenerateBatchFunction · 0.85
ToCharsFunction · 0.85
LookupAndValidateMethod · 0.80
fieldsMethod · 0.45
PopulateMethod · 0.45

Tested by

no test coverage detected