| 438 | } |
| 439 | |
| 440 | void VerifyCustomer(const std::vector<ExecBatch>& batches, |
| 441 | double scale_factor = kDefaultScaleFactor) { |
| 442 | const int64_t kExpectedRows = static_cast<int64_t>(150000 * scale_factor); |
| 443 | int64_t num_rows = 0; |
| 444 | |
| 445 | std::unordered_set<int32_t> seen_custkey; |
| 446 | for (auto& batch : batches) { |
| 447 | ValidateBatch(batch); |
| 448 | VerifyUniqueKey(&seen_custkey, batch[0], |
| 449 | /*min=*/1, |
| 450 | /*max=*/static_cast<int32_t>(kExpectedRows)); |
| 451 | VerifyStringAndNumber_Varlen(batch[1], batch[0], "Customer#"); |
| 452 | VerifyVString(batch[2], /*min=*/10, /*max=*/40); |
| 453 | VerifyNationKey(batch[3]); |
| 454 | VerifyPhone(batch[4]); |
| 455 | VerifyDecimalsBetween(batch[5], -99999, 999999); |
| 456 | VerifyCorrectNumberOfWords_FixedWidth(batch[6], |
| 457 | /*num_words=*/1, |
| 458 | /*byte_width=*/10); |
| 459 | num_rows += batch.length; |
| 460 | } |
| 461 | ASSERT_EQ(seen_custkey.size(), kExpectedRows); |
| 462 | ASSERT_EQ(num_rows, kExpectedRows); |
| 463 | } |
| 464 | |
| 465 | TEST(TpchNode, Customer) { |
| 466 | ASSERT_OK_AND_ASSIGN(auto res, GenerateTable(&TpchGen::Customer)); |
no test coverage detected