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

Function VerifySupplier

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

Source from the content-addressed store, hash-verified

344}
345
346void VerifySupplier(const std::vector<ExecBatch>& batches,
347 double scale_factor = kDefaultScaleFactor) {
348 int64_t kExpectedRows = static_cast<int64_t>(10000 * scale_factor);
349 int64_t num_rows = 0;
350
351 std::unordered_set<int32_t> seen_suppkey;
352 int good_count = 0;
353 int bad_count = 0;
354 for (auto& batch : batches) {
355 ValidateBatch(batch);
356 VerifyUniqueKey(&seen_suppkey, batch[0],
357 /*min=*/1,
358 /*max=*/static_cast<int32_t>(kExpectedRows));
359 VerifyStringAndNumber_FixedWidth(batch[1], batch[0], /*byte_width=*/25, "Supplie#r");
360 VerifyVString(batch[2], /*min_length=*/10, /*max_length=*/40);
361 VerifyNationKey(batch[3]);
362 VerifyPhone(batch[4]);
363 VerifyDecimalsBetween(batch[5], -99999, 999999);
364 CountModifiedComments(batch[6], &good_count, &bad_count);
365 num_rows += batch.length;
366 }
367 ASSERT_EQ(seen_suppkey.size(), kExpectedRows);
368 ASSERT_EQ(num_rows, kExpectedRows);
369 ASSERT_EQ(good_count, static_cast<int64_t>(5 * scale_factor));
370 ASSERT_EQ(bad_count, static_cast<int64_t>(5 * scale_factor));
371}
372
373TEST(TpchNode, Supplier) {
374 ASSERT_OK_AND_ASSIGN(auto res, GenerateTable(&TpchGen::Supplier));

Callers 1

TESTFunction · 0.85

Calls 9

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

Tested by

no test coverage detected