| 412 | } |
| 413 | |
| 414 | void 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 | |
| 435 | TEST(TpchNode, PartSupp) { |
| 436 | ASSERT_OK_AND_ASSIGN(auto res, GenerateTable(&TpchGen::PartSupp)); |
no test coverage detected