update histogram buckets from pointer to ObArrayWrap

This commit is contained in:
wangt1xiuyi
2023-02-10 11:11:04 +00:00
committed by ob-robot
parent 0a9101d215
commit ca1fcada83
23 changed files with 270 additions and 299 deletions

View File

@ -403,6 +403,7 @@ void TestOptimizerUtils::run_test(const char* test_file,
}
void TestOptimizerUtils::init_histogram(
common::ObIAllocator &allocator,
const ObHistType type,
const double sample_size,
const double density,
@ -418,14 +419,13 @@ void TestOptimizerUtils::init_histogram(
hist.set_sample_size(sample_size);
hist.set_density(density);
int64_t bucket_cnt = 0;
ObSEArray<ObHistBucket, 4> tmp_buckets;
hist.prepare_allocate_buckets(allocator, repeat_count.count());
for (int64_t i = 0; i < repeat_count.count(); i++) {
ObHistBucket bucket(repeat_count.at(i), num_elements.at(i));
tmp_buckets.push_back(bucket);
tmp_buckets.at(tmp_buckets.count() - 1).endpoint_value_.set_int(value.at(i));
bucket_cnt += num_elements.at(i);
hist.get(i).endpoint_num_ = repeat_count.at(i);
hist.get(i).endpoint_repeat_count_ = num_elements.at(i);
hist.get(i).endpoint_value_.set_int(value.at(i));
}
hist.add_buckets(tmp_buckets);
hist.set_bucket_cnt(repeat_count.count());
}
void TestOptimizerUtils::run_fail_test(const char *test_file)