| 376 | } |
| 377 | |
| 378 | void VerifyPart(const std::vector<ExecBatch>& batches, |
| 379 | double scale_factor = kDefaultScaleFactor) { |
| 380 | int64_t kExpectedRows = static_cast<int64_t>(200000 * scale_factor); |
| 381 | int64_t num_rows = 0; |
| 382 | |
| 383 | std::unordered_set<int32_t> seen_partkey; |
| 384 | for (auto& batch : batches) { |
| 385 | ValidateBatch(batch); |
| 386 | VerifyUniqueKey(&seen_partkey, batch[0], |
| 387 | /*min=*/1, |
| 388 | /*max=*/static_cast<int32_t>(kExpectedRows)); |
| 389 | VerifyCorrectNumberOfWords_Varlen(batch[1], |
| 390 | /*num_words*=*/5); |
| 391 | VerifyStringAndNumber_FixedWidth(batch[2], Datum(), |
| 392 | /*byte_width=*/25, "Manufacturer#", |
| 393 | /*verify_padding=*/false); |
| 394 | VerifyStringAndNumber_FixedWidth(batch[3], Datum(), |
| 395 | /*byte_width=*/10, "Brand#", |
| 396 | /*verify_padding=*/false); |
| 397 | VerifyCorrectNumberOfWords_Varlen(batch[4], |
| 398 | /*num_words=*/3); |
| 399 | VerifyAllBetween(batch[5], /*min=*/1, /*max=*/50); |
| 400 | VerifyCorrectNumberOfWords_FixedWidth(batch[6], |
| 401 | /*num_words=*/2, |
| 402 | /*byte_width=*/10); |
| 403 | num_rows += batch.length; |
| 404 | } |
| 405 | ASSERT_EQ(seen_partkey.size(), kExpectedRows); |
| 406 | ASSERT_EQ(num_rows, kExpectedRows); |
| 407 | } |
| 408 | |
| 409 | TEST(TpchNode, Part) { |
| 410 | ASSERT_OK_AND_ASSIGN(auto res, GenerateTable(&TpchGen::Part)); |
no test coverage detected