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

Function VerifyCustomer

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

Source from the content-addressed store, hash-verified

438}
439
440void 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
465TEST(TpchNode, Customer) {
466 ASSERT_OK_AND_ASSIGN(auto res, GenerateTable(&TpchGen::Customer));

Callers 1

TESTFunction · 0.85

Calls 9

VerifyUniqueKeyFunction · 0.85
VerifyVStringFunction · 0.85
VerifyNationKeyFunction · 0.85
VerifyPhoneFunction · 0.85
VerifyDecimalsBetweenFunction · 0.85
ValidateBatchFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected