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

Method TestMerge

cpp/src/parquet/statistics_test.cc:447–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445 }
446
447 void TestMerge() {
448 int num_null[2];
449 random_numbers(2, 42, 0, 100, num_null);
450
451 auto statistics1 = MakeStatistics<TestType>(this->schema_.Column(0));
452 this->GenerateData(1000);
453 statistics1->Update(this->values_ptr_, this->values_.size() - num_null[0],
454 num_null[0]);
455
456 auto statistics2 = MakeStatistics<TestType>(this->schema_.Column(0));
457 this->GenerateData(1000);
458 statistics2->Update(this->values_ptr_, this->values_.size() - num_null[1],
459 num_null[1]);
460
461 auto total = MakeStatistics<TestType>(this->schema_.Column(0));
462 total->Merge(*statistics1);
463 total->Merge(*statistics2);
464
465 ASSERT_EQ(num_null[0] + num_null[1], total->null_count());
466 ASSERT_EQ(this->values_.size() * 2 - num_null[0] - num_null[1], total->num_values());
467 ASSERT_EQ(total->min(), std::min(statistics1->min(), statistics2->min()));
468 ASSERT_EQ(total->max(), std::max(statistics1->max(), statistics2->max()));
469 }
470
471 void TestEquals() {
472 const auto n_values = 1;

Callers 1

TYPED_TESTFunction · 0.80

Calls 10

random_numbersFunction · 0.85
ColumnMethod · 0.45
GenerateDataMethod · 0.45
UpdateMethod · 0.45
sizeMethod · 0.45
MergeMethod · 0.45
null_countMethod · 0.45
num_valuesMethod · 0.45
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected