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

Function VerifyPartSupp

cpp/src/arrow/acero/tpch_node_test.cc:414–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414void VerifyPartSupp(const std::vector<ExecBatch>& batches,
415 double scale_factor = kDefaultScaleFactor) {
416 const int64_t kExpectedRows = static_cast<int64_t>(800000 * scale_factor);
417 int64_t num_rows = 0;
418
419 std::unordered_map<int32_t, int32_t> counts;
420 for (auto& batch : batches) {
421 ValidateBatch(batch);
422 CountInstances(&counts, batch[0]);
423 VerifyAllBetween(batch[2], 1, 9999);
424 VerifyDecimalsBetween(batch[3], 100, 100000);
425 num_rows += batch.length;
426 }
427 for (auto& partkey : counts)
428 ASSERT_EQ(partkey.second, 4)
429 << "Key " << partkey.first << " has count " << partkey.second;
430 ASSERT_EQ(counts.size(), kExpectedRows / 4);
431
432 ASSERT_EQ(num_rows, kExpectedRows);
433}
434
435TEST(TpchNode, PartSupp) {
436 ASSERT_OK_AND_ASSIGN(auto res, GenerateTable(&TpchGen::PartSupp));

Callers 1

TESTFunction · 0.85

Calls 5

CountInstancesFunction · 0.85
VerifyAllBetweenFunction · 0.85
VerifyDecimalsBetweenFunction · 0.85
ValidateBatchFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected