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

Function VerifyNation

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

Source from the content-addressed store, hash-verified

555}
556
557void VerifyNation(const std::vector<ExecBatch>& batches,
558 double scale_factor = kDefaultScaleFactor) {
559 constexpr int64_t kExpectedRows = 25;
560 int64_t num_rows = 0;
561
562 std::unordered_set<int32_t> seen_nationkey;
563 for (auto& batch : batches) {
564 ValidateBatch(batch);
565 VerifyUniqueKey(&seen_nationkey, batch[0], 0, kExpectedRows - 1);
566 VerifyOneOf(
567 batch[1],
568 /*byte_width=*/25,
569 {"ALGERIA", "ARGENTINA", "BRAZIL", "CANADA", "EGYPT",
570 "ETHIOPIA", "FRANCE", "GERMANY", "INDIA", "INDONESIA",
571 "IRAN", "IRAQ", "JAPAN", "JORDAN", "KENYA",
572 "MOROCCO", "MOZAMBIQUE", "PERU", "CHINA", "ROMANIA",
573 "SAUDI ARABIA", "VIETNAM", "RUSSIA", "UNITED KINGDOM", "UNITED STATES"});
574 VerifyAllBetween(batch[2], 0, 4);
575 num_rows += batch.length;
576 }
577 ASSERT_EQ(num_rows, kExpectedRows);
578}
579
580TEST(TpchNode, Nation) {
581 ASSERT_OK_AND_ASSIGN(auto res, GenerateTable(&TpchGen::Nation));

Callers 1

TESTFunction · 0.85

Calls 4

VerifyUniqueKeyFunction · 0.85
VerifyOneOfFunction · 0.85
VerifyAllBetweenFunction · 0.85
ValidateBatchFunction · 0.70

Tested by

no test coverage detected